0

I wants to download all content of a Folder in FirebaseStorage. I can download a only file (image) like this:

FirebaseStorage storage = FirebaseStorage.getInstance();

    try {
        final File localFile = File.createTempFile("ImagensExercicios","bmp");
        storage.getReference().child("ImagensExercicios").child("abdominal_1.bmp").getFile(localFile).
                addOnSuccessListener(new OnSuccessListener<FileDownloadTask.TaskSnapshot>() {
            @Override
            public void onSuccess(FileDownloadTask.TaskSnapshot taskSnapshot) {
                Log.i(TAG,"onSuccess()");
                Bitmap bitmap;
                bitmap = BitmapFactory.decodeFile(localFile.getAbsolutePath());
                imageView.setImageBitmap(bitmap);
            }
        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception e) {
                Log.i(TAG,"onFailure() " + e.getMessage());
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    }

This works, but I wants download all images of the folder. Exists a way to do this?

Augusto
  • 3,825
  • 9
  • 45
  • 93
  • There is no API to get a list of all files in a folder in Firebase Storage. See https://stackoverflow.com/questions/37335102/how-to-get-an-array-with-all-pictures – Frank van Puffelen Aug 16 '17 at 03:31

1 Answers1

0

In the firebase folder rename the items as
abdominal_1.bmp
abdominal_2.bmp
abdominal_3.bmp
And use above try catch inside a forloop.

Amila
  • 244
  • 1
  • 12