Search code examples
androidandroid-imageviewimage-loading

ListView Image Loading Android


I am trying to make a listview which has a textview and an imageview for each row. In the imageview i am trying to load thumbnails using a custom adapter. My question is that if I have about 1000 thumbnails, is it a good idea to save images in res/drawable folder and directly load from there (as the images are really small about 2-4kb). Or is it a better option to download them from a web url and them load them into the listView. Can someone help me on finding out the wiser solution. Also later on its possible that i use more than 1000 thumbnails.

thanks


Solution

  • If you are keeping all the 1000 images in the res folder, the application size will increase by 2-4 Mb.

    So, better go for downloading images from web server using lazy loading. Because, usually users won't scroll down to more that 100 items. So to show <100 images for 99% of the time, its useless to have all the 1000 images in the application res folder.

    Check the highest voted answer here:

    Lazy load of images in ListView

    Thats what i am using in my application. Very happy with it.