I am working on one application and getting product images from the server. Currently I am saving those images into the SQLite database after converting them into byte array and at the time of use I convert them back into bitmap.
Now I have below two queries:
What is the best way to save the images in app from where we can sync them also and get when ever required.
How to assign them on image view or button because sometimes memory issue arises and application stop suddenly.
Please guide me. Any help is appreciated.
Demo code
Storing app specific things on SD Card may not be the right way.. You should store images on
and put image files here in that folder.. So SD Card dependency can be removed.
Save them as a file on the external storage:
will create a directory to store the pictures in.
Then check out this guide here how to load only the right amount of pixels for your Image. Else you will get an OutOfMemory exception. (5MP picture will take up to 20MB of the heap)