简体   繁体   中英

Firebase Storage Android App Image Gallery

I'm a beginner in building an android app, i want to show a gallery of 5-6 images for a user profile. My firebase storage architecture is "multiple_images(a folder)\\userid(5-6 images in a user id folder)".

If possible can someone please share some sample code, i'm unable to figure out how i will put the object of a 5-6 images from a user folder and show it in an activity. I have referred the docs of Firebase but it only shows a sample code for a single file.

I think you are talking about bulk upload into a firebase storage folder. As it turns out there is no bulk upload feature yet in firebase storage. Although there are 2 ways I would achieve this.

Method 1:

you can chain multiple calls so as to upload all your files sequentially. This method would add all the files in your android app but it will be hard to track bugs when there is an upload error.

Method 2:

Write an Intent service that has your firebase upload logic. This service gets called every time the user uploads an image into your android app. This triggers multiple service instances each of which will upload the image and since these are processed in a queue it is easy to track bugs and do error handling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM