1

I want to save the images fetched from server for once and from next time i want to check first whether images are stored or not in device, if not then again it should fetch from server and store in user's device again, and if yes then application will use images directly rather than fetching from server again and again. It will be useful for enhancing the speed of application. Basically my application is fetching multiple images from server so i want to save those images on user's android device and from next time application should fetch from device. I think you got my question.

daemmie
  • 6,361
  • 3
  • 29
  • 45
Vishal Jain
  • 175
  • 2
  • 18

1 Answers1

2

The simple way:

You can use Picasso. It is a simple lib which provides image downloading and caching. In my opinion it might not be the fastest, but it is pretty simple and intuitive. It does its job well and none who I asked complained about it.

Picasso

Other libs:

UIL

Volley

Glide

fresco

To make it short. There are lots of other libs. An awesome comparision of the most Populat ones can be found here and here


The do it yourself way:

You can also write you own caching logic with a LRUCache. Which is also pretty simple.

Take a look at:

https://developer.android.com/topic/performance/graphics/cache-bitmap.html

The LRUCache is just a Memory Cache so you might also want to use a DiskLRUCache

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
daemmie
  • 6,361
  • 3
  • 29
  • 45