How to insert uri image into sqlite database in android?

I am writing an application that uses the camera for shooting. I get the uri of the image (which is saved in the gallery) and can display the image in ImageView. I am trying to find the best way to save this uri in a SQLite database so that I can later load it and put the image in ImageView. Am I using a blob to store uri? If so, how do I do this? Or can I convert uri to String and save it that way? I was looking for an answer, and I have to use the wrong search words because I cannot find the answer to the question, which should be simple.

+3
source share
1 answer

It will depend on how you want to access it later. There are two options for what you are considering: since the image is already saved on your phone, there is no need to save it twice as a drop. Or, if you move the image to your phone or delete it, it will be better. In fact, it would be better for you to save the image in a directory reserved only for images from your application, and then read all the file names in this directory later for access.

0
source

All Articles