7

I'm implementing an Android gallery widget. I'm asking how to lazy (i.e. in a separate thread) load images from the web and persistently cache them? So that on the next run I have the cached images locally available...

MarcoS
  • 17,323
  • 24
  • 96
  • 174

4 Answers4

7

This is how:

Lazy load of images in ListView

Check the demo in the second answer, helped me massively!

Community
  • 1
  • 1
Daniel Frear
  • 1,459
  • 14
  • 22
5

Try this code.the universal imageloader.

https://github.com/nostra13/Android-Universal-Image-Loader

jithu
  • 706
  • 1
  • 9
  • 13
0
    You have to use Picasso. 

    it's easy to use

    downlod latest jar from  http://square.github.io/picasso/

    simply load image used below code

    Picasso.with(context)
               .load(url)
               .placeholder(R.drawable.placeholder)
               .resize(imgWidth, imgHeight)
               .centerCrop()
               .into(image);
0

Try to use this tutorial Android: Help in adapting ListView adapter with an ImageLoader Class (LazyList)

Hope, it's helps you!.

Community
  • 1
  • 1
ihrupin
  • 6,932
  • 2
  • 31
  • 47