Search code examples
androidandroid-viewpagerlazy-loadingandroid-imagefetching-strategy

Lazy Loading vs. Batch Download in Android (if all images will be used0


I am building an Android app that shows full screen images in a carousel. The app downloads 100 objects from the server and stores them in the app. Each object is represented by a full-screen image and some text.

The user will see all downloaded objects as full screen images.

Question: is it more efficient to use lazy loading one image at the time when the user goes through the carousel or download images in full batches?

Google suggests using batching and pre-fetching: http://developer.android.com/training/efficient-downloads/efficient-network-access.html#BatchTransfers

Also, it is my understanding that one of the key benefits of lazy loading is avoiding downloading images that will not be used. In my case, the user will see all images of the all downloaded objects.

Thanks!


Solution

  • The first target is that the user sees the images without delay. By creating a batch starting from the first image it is probable that he will have the following images loaded when he scrolls through them. If in your case the user can scroll fast through the images, you can change the batch list and set a higher priority on the images he is going to see (like 3 plus and minus from the current position).