Reputation: 2676
I'm trying to implement Image Caching into my app. The code i currently have regarding the images is below:
Network call to get images:
public void getImage(String url, final ImageView imageView) {
System.out.println("Image Url is: " + url);
ImageRequest requestImage = new ImageRequest(url, new Response.Listener<Bitmap>() {
@Override
public void onResponse(Bitmap response) {
imageView.setImageBitmap(response);
}
}, 0, 0, null, null);
queue.add(requestImage);
}
How could I implement the caching? I have read a few articles on SO, but am not sure on how to implement it into my app?
Thanks for your help
Upvotes: 1
Views: 89
Reputation: 12478
ImageLoader
instead of using ImageRequest
directly.ImageLoader
object, you set an ImageCache
object. (That is what you want, isn't it?)Volley's ImageLoader
uses internally ImageRequest
convined with ImageCache
.
Upvotes: 2
Reputation: 1984
I think you should try this one of the best image caching library :
https://github.com/loopj/android-smart-image-view
Upvotes: 0