1

My application uses quite a lot of pictures that are downloaded from the multiple URLs and cached locally on the Android phone.Each image have connect to particular Id in SQLite Database . I am wondering, what is the correct way to save those pictures. There are several ways I see.

Save them on SD Card in a public folder

Save them on directly in SQLite Databse

Please suggest me which is better approach to save these image locally.

tech_android
  • 719
  • 1
  • 7
  • 18

2 Answers2

1

Use third party library like releam

0

I recommend libraries oriented for this common functionality to save lots of work and get the best performance and easy updates. You can choose between Universal Image Library or Picasso or Fresco, these three are maybe among the best-known between many others. Check this SO thread or search for differences to know which fit best for your case.

Hope it helps.

Community
  • 1
  • 1
Hugo
  • 1,662
  • 18
  • 35
  • Thanks fro reply @Hugo But how to reuse these images when user offline – tech_android Oct 31 '16 at 10:01
  • These libraries provide options to save images in cache volatile memory and also to "hard saving" images in long term memory. Just select one of them, and take a look at it's documentation or search for the concrete question. I'm sure there are threads talking about it here in SO. – Hugo Oct 31 '16 at 10:15
  • Check this http://stackoverflow.com/a/26831674/3214497 to do it with UIL for example, it's the library I use in my projects. And please consider mark the answer as the correct one if so. Remember, this is a help forum. You should also work in your own code and read official documentation. Thanks – Hugo Oct 31 '16 at 10:20