4

I have already implemented AQuery throughout my app for image loading. I have not used Volley Image caching yet and wondered if I could also use it for image caching as well. For what purposes might Volley API be a better fit than AQuery?

TestBest
  • 915
  • 5
  • 12
  • 22
  • Another option: https://github.com/novoda/ImageLoader . But if you are using Volley for Http then I would also try it out for Image loading. Square also have an image loading library with a great fluid API – Blundell Aug 03 '13 at 00:04
  • AQuery has a bug, that when internet connection is bad it sometimes returns black bitmap instead of null or error. Moreover it saves this black bitmap to cache. Author doesn't do much with reported bugs because lack of time. – Malachiasz Aug 03 '13 at 06:38
  • Take a look at [droidQuery](http://bit.ly/droidquery). To lazy-load an image from a URL, you can use `$.with(view).image(url);` – Phil Aug 14 '13 at 15:20

1 Answers1

1

You will need to write your own ImageCache implementation if you use Volley.

If you want an integrated implementation that you have the most control over, use Volley. There's probably an implementation out there for ImageCache on GitHub already.

If you want a fast way to load images, use Android Universal Image loader or AQuery. If you haven't tried already, Android Universal Image Loader works quite well.


EDIT

There's a good implementation of the ImageCache interface here:

https://github.com/rdrobinson3/VolleyImageCacheExample/blob/master/CaptechBuzz/src/com/captechconsulting/captechbuzz/model/images/BitmapLruImageCache.java

This requires the support library.

Brad
  • 9,113
  • 10
  • 44
  • 68
  • 1
    After researching this further it looks like an BitmapLruCache derived from the one in android support package is the way to go. So there is something to start with. – TestBest Aug 05 '13 at 20:55
  • You're right, it looks good. Take a look at this [implementation](https://github.com/rdrobinson3/VolleyImageCacheExample/blob/master/CaptechBuzz/src/com/captechconsulting/captechbuzz/model/images/BitmapLruImageCache.java). – Brad Aug 07 '13 at 01:15