I am bit a newbie in this area ... so it may sound like a basic question to you ... but for me however this poses a huge challenge. Here is what I'd like to do:
1. Write an image file (png) into an SQLite DB (I guess I have to go with BLOB to do this but not sure exactly how)
2. Then pull this PNG image from the DB to show it in a regular listview (regular list adapter) and combine it with corresponding text
So for example, one DB entry would have an image of an apple, the word "apple" as a text to describe the image and a couple of parameter to describe the nutritional value of the apple, like calories, vitamins, and so on.
Another entry would have an orange or a banana ...
Then show all those DB entries in a listview (image + corresponding text elements) to make it look like this:
---------------------------------------------------------
<Apple PNG> Apple, 30 kcal, 3mg vitamin C
---------------------------------------------------------
<Orange PNG> Orange, 45 kcal, 10mg vitamin C
---------------------------------------------------------
and so ......
---------------------------------------------------------
I am aware that I could use a custom list adapter and pull the image from @drawables but the SQLite approach seems more elegant and appropriate to me.
As I am novice I would appreciate a tutorial & sample code that shows how to do this.
Thanks in advance.
Best regards Christian







