I want to make image backup through my Application
what is the best way for storing large amount of data . I tried to save image in sqlite database
it worked fine for small amount of data in case of large amount it shows MemoryOutOfBoundExceptions
after increasing the Heep size(android:largeHeap="true")
.
please help me guys .

- 20,189
- 8
- 67
- 95

- 671
- 2
- 11
- 22
3 Answers
If you want to save only image or any file try to save only path of that file in database.After that you can get file path by normal SQL query and access file from file path.
Instead of Storing Large data in Application
you have to store it DataBase
so it will speed up your Application and you have no Exception
produce like OutOfMemoryException
in your Application
.

- 20,189
- 8
- 67
- 95
-
m tyied to store in DataBase by converting image into bitmap than compress() But this process also give me OutOfMemoryException – xyz rety Jun 26 '16 at 09:32
-
@xyzrety visit this link it will help you to store `Image` in `DataBase`. http://stackoverflow.com/questions/9357668/how-to-store-image-in-sqlite-database – Harshad Pansuriya Jun 26 '16 at 09:34
-
@xyzrety you have go through `DataBase` it is right Approch. – Harshad Pansuriya Jun 26 '16 at 09:49
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/115627/discussion-between-xyz-rety-and-ironman). – xyz rety Jun 26 '16 at 09:49
You don't store images in databases, that makes the database huge and slows it down. Store the images to disk and store the path to the file in the database. This will make the database a lot lighter and faster.
If you're developing for Android, i'd also recommend using something like Picasso, Fresco or Glide to display your images too. They cache the image and use memory efficiently when doing operations like scaling images.

- 1,467
- 3
- 19
- 34