SQLite pictures and blobs

Andras

Active Member
Licensed User
Longtime User
Following helpful advice here I'm now successfully loading pictures (and other data) held on an SQLite database. The pictures are identified by their filenames in the appropriate field, and are presumably added to the APK at compilation time (is that right?) and are then shown on-screen when appropriate with this code (irrelevant other data left out!):

Picture = mCursor.GetString("Picture")
ImgPicture.SetBackgroundImage(LoadBitmap(File.DirAssets, Picture))

This works a treat, but adding new records to the database results in an error (basically, picture not found) unless the program is recompiled, at which point of course the new materials go straight into the APK and all appears well.

So here's the question: is it possible to get pictures for new records to be found without them needing to be 'in' the database as blobs? If so, how?

Thanks!
 

NJDude

Expert
Licensed User
Longtime User
The File.DirAssets is a directory in your APK, this directory is READ ONLY, you must save the database and the pictures to another directory such as DirDefaultExternal.

More info about directories HERE
 
Upvote 0

Andras

Active Member
Licensed User
Longtime User
Thanks, Dude; yes, I was aware of that, but on re-reading the code I'd written it looks as though I'd managed to get a COPY command going the wrong way!

I clearly need to take a closer look at what I've written to see if that's the only problem or if I've managed to do something else stupid!

Thanks!

JOhn
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…