I am writing an app that uses the camera intent to take a picture. I get the uri of the image (which is saved in the gallery) and can display the image in the ImageView. I am trying to figure out the best way to save this uri in the SQLite database in order to retrieve it later and put the image in the ImageView. Do I use a BLOB to store the uri? If so, how would I do this? Or do I convert the uri to a String and store it that way? I’ve been searching for an answer and I must be using the wrong search words, because I can’t find an answer to what should be a simple question.
Share
It would depend on how you want to access it later. For what your’re considering there are two options, since the image is already saved on you phone, there is no need to save it twice as a blob. Or if you will move the image on the phone or remove it, having it in a blob would be better.
In reality, you’d be better service saving the image in a directory set aside just for images from your app and then reading all the file names in that directory later for access.