Search code examples
androidandroid-imagedisk-access

Store images economically in android app


My app uses images from a URL and I want to reduce resources usage for both server and client. I wonder if the Android SDK already offers something for this (if there's some standard way to do it) or I just have to figure it out. What I have in mind is:

  • download images on local storage (external or internal) when accessing content (lazy loading, progress bar) and keeping them there for next use
  • update images (download and replace) if changed on server (keep checksum in a database that is queried when the application is started)
  • in order to avoid excessive local disk usage (they are quite big), delete images for content that has not been accessed for N days. This is done while loading the app or in a background asynchronous service

Should I do this step by step or is there something that already takes care of it. Are there libraries to do this properly?


Solution

  • I think Picasso library is best for this, it has many capabilities and is really easy to use, its features include smooth image caching (the features you need), image processing and Async downloading from URL too. It has so many useful features.

    Here is its url link

    http://square.github.io/picasso/