0

I have a few questions about database storage and retrieval of images. I have an activity that prompts the user to either take a picture using the camera or selecting an existing from the gallery. When a picture has been taken/selected, it is shown in the activity and should be saved in a sqlite database (I use my own content provider).

  1. Should I store the images as a blob or store them seperately and then only store the URI pointing to the requested image?

  2. How do I show the image and save it?

Arcadia
  • 266
  • 4
  • 17
  • this link may be useful for you: http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay – wleao Jul 21 '11 at 17:48
  • possible duplicate [Android, how to store images](http://stackoverflow.com/questions/3296850/android-how-to-store-images-from-url-save-it-in-sd-card) – wleao Jul 21 '11 at 17:52
  • Thanks I'll stick with the uri storage :P – Arcadia Jul 21 '11 at 18:02

1 Answers1

0

It really depends on the size of your images.

Saving the images to disk and databasing uri's is the is the only sensible suggestion for photographs, however if you are only storing small thumbnails (like avatars), these could be safely stored as blobs without too great a performance hit.

As your application description suggests that you are taking photographs, you should use uri's.

Moog
  • 10,193
  • 2
  • 40
  • 66