-1

My app is downloading images with Picasso like this:

   Picasso.with(getBaseContext()).load("https://www.sestavsisvujsvet.cz/files/magnetky/"+id+".png").placeholder(R.drawable.magnetka_placeholder).error(R.drawable.magnetka_placeholder).into(obrazek);

and it works well, but I need to save images to disk, because Picasso's caching mechanism isn't enough (I have up to 870 images which will be frequently seen by the user). Is there any way to download the image, store it and load it from disk later?

I tried to find some solution to this, but I wasn't able to find anything useful. Maybe it would be better to download them without Picasso, but I am not sure if it's possible. I don't mind replacing Picasso completely and using another library, as long as it's capable of saving the images.

Thanks!

Etoile
  • 161
  • 10

1 Answers1

-1

Please have a look at this for downloading image.

There are some changes in getting android storage for that please have a look here

After downloading images you need to manage them locally, use sqlite for keeping track of your files.

Basically you need to download images, and after success, save entry in Database which will include fields like location, file_name, create_on, etc. Now you can get images from database

Hope this will help!

Rahul Gaur
  • 1,661
  • 1
  • 13
  • 29