Friday, August 27, 2010

Lazy Loading of Images in List-view in android

Suppose ,you have a list View in your activity where you have to download the data and corresponding images and show it in the list.

Generally if you download both the data and images once and after  downloading of data you will show it in the list which will take a longer duration particularly depends on net connectivity speed.

For Reducing the time ,first we download the text ie.,names,links except images .we will put the download links in a stack and we will download them after displaying the list-view by using late downloading of images.
First the list will show and images will show in their corresponding position in the list whenever it got downloaded exactly like android market application.
This will reduce the time and we can download as many items we want to show as like working of android market list view.
You can download the sample working project by clicking here Download the full working Project.

Hope it helps you in writing fast applications.

If it doesn't work for you ,please let me know.


16 comments:

  1. I m crazy when not a view example.

    ReplyDelete
  2. The bossic listview loader i have ever seen !!!!!!!!!!!!!!!!!!!

    ReplyDelete
  3. Really cool program! Thank you alot!

    ReplyDelete
  4. Doesn't work. images are not loaded

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. @Brian:look @ your manifest It should work!!

    ReplyDelete
  7. uses-permission android:name="android.permission.INTERNET"
    uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"

    ReplyDelete
  8. Thanks sir,good work.

    can you please tell me how to load text from web along with images

    ReplyDelete
    Replies
    1. do you want to load from uri or like web service calls..?

      Delete
  9. Hey, cant we build this to Android 2.2 platform?

    ReplyDelete
  10. how can i add progress bar for each downloads...and time to download each item...

    ReplyDelete
  11. The link share by you is very useful. I was going around search on Google and found this link Image Loader. Please review if its useful

    ReplyDelete
  12. image is not uploading .. its jus retriving from the given url.how to download image

    ReplyDelete

Android Developers Blog

Ram's shared items