0

Just a quick question as I'm facing an issue here:

What's the best way, in terms of performances and speed, to populate a ViewPager from a list of URL stored on Firebase,using Glide ??

I mean, should I pass an array containing the URLs to the ViewPager Constructor? Get those URL from Firebase directly on the FragmentPagerAdapter class?

Cheers

koceeng
  • 2,169
  • 3
  • 16
  • 37
Andy Strife
  • 729
  • 1
  • 8
  • 27
  • 1
    Yes. Glide is even recommended by Google. Based on your needs you can switch between Glide and Fresco. Two of the best image loading libraries in my opinion – rohitanand Feb 16 '17 at 06:24
  • http://stackoverflow.com/q/29363321/4625829 – AL. Feb 16 '17 at 07:05
  • in my Android-FirebaseApp I rely on Picasso, http://square.github.io/picasso/ – Khaledonia Feb 16 '17 at 08:08
  • @Alexander I've also used Picasso. But then I discovered Glide. It has better performance because of it's image compression algorithm. You should give it a try – Rosário Pereira Fernandes Feb 16 '17 at 08:35
  • @RosárioPereiraFernandes may I ask how are allowing your users to upload their graphic data? In my application I convert their data to the desired bitmap quality and then upload it. Picasso has been cordial to the users all the way so far. – Khaledonia Feb 16 '17 at 08:38
  • Thanks guys for the comments. However, my issue is not whether or not using Glide (which I Love and use very often) but it's about when/where loading the Images URLs. What is the best and most efficient/quick way in terms of "architecture" – Andy Strife Feb 16 '17 at 19:05

1 Answers1

0

Ok so after multiple tries and testing, here is what I have found to be the quickest:

Load all the URLs into a String Array and pass it to the ViewPager Constructor.

If you load the URLs on the fly directly from the ViewPager Class, it is slower.

I hope this will help others in the Future

Andy Strife
  • 729
  • 1
  • 8
  • 27
  • Can I get the URLs from knowing just the appsot URL? Because, if I add some images on Firebase, I need not change the Studio code all over again. – Sumukh Bhandarkar Jul 22 '19 at 10:07