Assume that images is the directory of your firebase database which you want to clear.
private static DatabaseReference mDatabase;
public static void clearData(){
mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("images").setValue(null);
}
Here images is the parent directory of the database. If you want to clear a nested directory (DCIM) inside the images directory so that you can retain the remaining data in it.
In that scenario you can do like this,
mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("images").child("DCIM").setValue(null);
As a response to the query, Please try to use setValue method with null value setValue(null)
to clear the data from firebase database