0

I don't know whether this is repeated question or not, but i didn't find any solution for my question.

I created a project in Firebase and in Storage section I added some folders and in that folders I placed 10 images in every folder.

Now what I want to do is,If I visit that particular (which has 10 images) I want to fetch all the 10 images, and display in RecyclerView.

FirebaseStorage storage;
storage = FirebaseStorage.getInstance();
    reference = storage.getReferenceFromUrl(getResources().getString(R.string.image_reference));
    Log.e(TAG, "onViewCreated: " + reference.child("folder1").getPath() );

In docs they said about download only one image at a time. But don't know how to display all the images in recyclerview.

Example : when you create your own API you will be sending all the json data, and in android we will be populating it in recyclerview.

But in Firebase how to achieve this. Suppose if I have 1000 Images in one folder, then how to use pagination in this scenario.

Please guys I anybody know , plz help me. Any kind of help is appreciated.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Mohd Asif Ahmed
  • 1,880
  • 2
  • 15
  • 29
  • There is no API in Firebase Storage to list images. This means you'll need to use some other data sharing mechanism (such as the Firebase Database) to share the list of image locations. See http://stackoverflow.com/questions/37335102/how-to-get-an-array-with-all-pictures/37337436#37337436 – Frank van Puffelen Oct 31 '16 at 16:22

1 Answers1

1

You should keep a track(filename) of the files in the storage first. Then you can download all the files one by one. See official sample for storage here.

For pagination you should use database references.

ugur
  • 3,604
  • 3
  • 26
  • 57
  • Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Ali Bdeir Oct 31 '16 at 15:37
  • I don't want users to download the images, I just want to display the images. When user clicks on that image, then only the image should be download – Mohd Asif Ahmed Oct 31 '16 at 15:45