populating array with images from a Firebase storage folder

SkyeBoniwell

So I managed to get my Android app working with both Firebase and Glide and I'm able to load a single image from Firebase into an ImageView like this:

imageview1;

imageview1 = (ImageView)findViewById(R.id.ivTest);
String url1 = "https://firebasestorage.googleapis.com/v0/b/zxtrix-e017d.appspot.com/o/fullsize%2Falligator.jpg?alt=media&token=1b85f1c4-4133-41d8-a65f-eg2e263g0403";
Glide.with(getApplicationContext())
     .load(url1)
     .into(imageview1);

However, I'm currently loading an array of images from my /res/ folder like this, and I want to change it so that it loads from Firebase instead.

Integer[] ApocImages =  {R.drawable.image1, R.drawable.image2, R.drawable.image3, R.drawable.image4,
        R.drawable.image5, R.drawable.image6, R.drawable.image7, R.drawable.image8,
        R.drawable.image9, R.drawable.image10, R.drawable.image11, R.drawable.image12,
        R.drawable.image13, R.drawable.image14, R.drawable.image15, R.drawable.image16};

I've uploaded all the images in my /res/ folder to my Firebase app storage area.

How can I now load them from Firebase into my array?

Thanks!

Meet Patel

You can make an array of URL same as drawable you made.

String[] url =  {"https://firebasestorage.googleapis.com/v0/b/zxtrix-e017d.appspot.com/o/fullsize%2Falligator.jpg?alt=media&token=1b85f1c4-4133-41d8-a65f-eg2e263g0403",
"https://firebasestorage.googleapis.com/v0/b/zxtrix-e017d.appspot.com/o/fullsize%2Falligator.jpg?alt=media&token=1b85f1c4-4133-41d8-a65f-eg2e263g0403",
"https://firebasestorage.googleapis.com/v0/b/zxtrix-e017d.appspot.com/o/fullsize%2Falligator.jpg?alt=media&token=1b85f1c4-4133-41d8-a65f-eg2e263g0403"}; 

After this, set for loop

for (int i=0; i<url.size; i++) {
    Glide.with(getApplicationContext())
         .load(url.get(i))
         .into(imageview1);
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Populating a RecycleView with images from Storage References with Glide

From Dev

Downloads images from firebase storage

From Dev

Populating Tableviews with Images in Firebase

From Dev

Delete folder with contents from Firebase Storage

From Dev

Delete folder with contents from Firebase Storage

From Dev

Unable to show images from Firebase Storage

From Dev

retrieving images from firebase storage to show in a component

From Dev

retrieving images from firebase storage to show in a component

From Dev

Unable to show images from Firebase Storage

From Dev

Proper Way to display images from Firebase Storage

From Dev

Retrieving images from Firebase Cloud Storage

From Dev

Retrieving a folder of Images from Azure Blob storage -Swift

From Dev

Populating array from file

From Dev

Populating a hash from an array

From Dev

Firebase Storage retrieval images

From Dev

Display images from firebase storage in html img tags

From Dev

How to download and view images from the new Firebase Storage?

From Dev

Populating a ListBox from row array

From Dev

Array not populating from For Loop VBA

From Dev

populating text from array with ajax

From Dev

Populating a @mentions array from mysql

From Dev

Populating VBA array from a textbox

From Dev

Swift - Populating array from JSONElemetns

From Dev

How to create a folder in Firebase Storage?

From Dev

Trouble displaying individual images from array (Rails active storage)

From Dev

Get storage space used in a folder in Firebase Storage

From Dev

Array Adapter Load Images from Res Folder (Android App)

From Dev

getting multiple images from folder and save image names to json array

From Dev

View images from a folder

Related Related

HotTag

Archive