I'm a newbie and couldn't find anywhere, concise information regarding which approach I should be taking when working with images.
The thing is I'm developing an app whose main purpose is to keep track of things, for each of whose entry you can have an associated image. This image is to be selected via gallery through an intent with ACTION_GET_CONTENT and receiving it in onActivityResult(...).
This last part became somewhat complex since from KitKat when you do something like:
Uri uri = data.getData();
and then uri.getPath() or uri.toString() you get something like /document/image:151. This path for sure you can't save it to SQLite DB, or if you could it wouldn't be of any use.
This brings me to my real question. Which is the best way to store this?
- Duplicate the file in your sd app folder from the stream
- Create methods with content resolvers for getting the real path (probably using as guide aFileChooser lib from Paul Burke)
- Save the image as a bit array directly into DB. (this one sounds like a bad practice from my experience, but I've seen a lot of people doing it)
- Other (specify)