开发者

Image storage and retrieval using sqlite db

开发者 https://www.devze.com 2023-03-21 21:09 出处:网络
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. Whe

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消