-6

Does we have any method/Class for caching like in iOS Afnetworking., if yes or not kindly suggest me this class to use?

Gopal Singh Sirvi
  • 4,539
  • 5
  • 33
  • 55
  • You can use 'Universal Image Loader' which offers many customization in caching images.check the link https://github.com/nostra13/Android-Universal-Image-Loader – darwin Jul 13 '15 at 12:18
  • 3
    Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. – NaijaProgrammer Jul 13 '15 at 12:24

4 Answers4

2

There are several solutions that you can use, it depends on what you need. If you want to cache images on L1 (ram) you can use the SDKs LRUCache (or from the support v4) and easily set it up as BitmapLruCache. If you need to cache images on both L1 and L2 (disk) you can use "2 level LRU cache" solutions on GitHub (such as wuman/TwoLevelLruCache and such).

If you need caching as part of an image loading library you can check out one of the following: (they all have L1/L2 caches)

** Picasso (by Square): It's simple and and easy to use. http://square.github.io/picasso/

** Glide Has the same API as Picasso but contains some enhancements (such as animated GIF support) https://github.com/bumptech/glide

** Fresco (by Facebook): This thing is a bad ass machine, pretty simple to use but contains really impressive set of capabilities. Wouldn't use it for a simple. https://code.facebook.com/posts/366199913563917/introducing-fresco-a-new-image-library-for-android/

(github: https://github.com/facebook/fresco)

you can also see some comparisons here:

Picasso v/s Imageloader v/s Fresco vs Glide http://vardhan-justlikethat.blogspot.co.il/2014/09/android-image-loading-libraries-picasso.html

Cheers!

Community
  • 1
  • 1
MarkySmarky
  • 1,609
  • 14
  • 17
0

Try Picasso lib. Its work in many cases.

Tronum
  • 707
  • 3
  • 13
0

You can use Android's volly library for caching:

https://github.com/rdrobinson3/VolleyImageCacheExample

In above link, you can see sample for how to use it.

Kinnar Vasa
  • 397
  • 1
  • 9
0

Universal image loader,Picasso and lazyloading are the best available options for the image caching purpose which i have used.

Parin Parikh
  • 775
  • 1
  • 6
  • 17