Reputation: 463
In my application I use SoftReference to cache images, it is working fine with active internet connection. And now I need to cache images, so I could use it in offline mode.
What is the best way to implement it? Use complex solution with SoftReference and database? or maybe SoftReference and local storage (sdcard)?
I would appreciate your advices. Thanks.
Upvotes: 2
Views: 3322
Reputation: 73484
2 level cache in memory and on disk. Check out the https://github.com/mttkay/droid-fu project on github. It contains an ImageCache that works this way.
Upvotes: 2
Reputation: 302
Late answer, But I hope it still counts for something. ImageDownloader is the best one for the job. I also found a slight variation of the class at:
http://theandroidcoder.com/utilities/android-image-download-and-caching/
The main difference between the two is that the ImageDownloader uses the Android caching system, and the modified one uses internal and external storage as caching, keeping the cached images indefinitely or until the user removes it manually. The author also mentions Android 2.1 compatibility.
Regards, EZFrag
Upvotes: 0