1

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 .

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
xyz rety
  • 671
  • 2
  • 11
  • 22

3 Answers3

1

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.

0

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.

Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
0

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.

Nickmccomb
  • 1,467
  • 3
  • 19
  • 34