SQLite and jpegs

Andras

Active Member
Licensed User
Longtime User
My 'learning B4A' project - which involves creating an address database with details of various friends - has now reached the stage of wanting to put in a photo of each of the people listed. So two questions to which I haven't been able to find an answer:

1 - how do I get a picture from file into SQLite as a blob? I understand it has to be a byte string (obviously, really) but beyond that I'm unsure.

2 - and how do I then display it in the Android app?

(After solving this I suspect my next task will be putting in a map of where each of them lives! I'll learn all the ins-and-outs of this if it kills me!)

TIA!

John
 

Andras

Active Member
Licensed User
Longtime User
Very grateful indeed to those who have replied, but I confess to still being a little stuck.

I have an existing SQLite database (created outside B4A) with columns for various text, integer or whatever items, and I can now - thanks to various peoples' help! - display and manipulate them with no trouble in B4A; but if in addition one column contains a blob - a jpeg file - I'm not sure how to display that blob; I presume that I need an array with each blob (for each record) occupying one place in the array, but that's as far as I can get.

I realise that I'm really feeling my way here, so help is truly appreciated!

John
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
Hi.

1) Did you check out the example code on the tutorial page i linked to?

2) This thread is in the wrong forum and you'll probably find not many B4A users will even notice it.
Start a new thread in the B4A forum or ask for this thread to be moved across to the B4A forum.

Martin.
 
Upvote 0

Andras

Active Member
Licensed User
Longtime User
Indeed I did, Martin - and very grateful for your help! I suspect that my basic problem is that I'm quite new to this way of file-handling. I'm posting a more detailed query on the latter topic elsewhere; in the meantime many thanks!

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