1

So I'm learning about Firebase Storage for android and I've hit a wall. I want to get all the images I have stored in a folder in my Firebase Storage and once I get a reference to them I want to stored them in a ListView or RecyclerView. How Do i do that? I mean I can get reference to the folder:

StorageReference storageReference =  FirebaseStorage.getInstance().getReference("gallery");

But then how do I get all the images in the gallery folder and display them in a Listview or recyclerView?

josecdeveloper
  • 11
  • 1
  • 2
  • 2

1 Answers1

1

There currently is no API call in Firebase Storage to list all files in a folder. If you need such functionality, you should store the metadata of the files (such as the download URLs) in a place where you can list them. The Firebase Realtime Database is perfect for this and allows you to also easily share the URLs with others.

add image name to the Firebase Realtime Databse and fetch from it

and get Url like ,

mStoreRef.child("<folderNameInStorage>/" +""<imageName>).getDownloadUrl().addOnSuccessListener();

this is the way.

Rajesh Satvara
  • 3,842
  • 2
  • 30
  • 50