Has anybody an idea, how to add an BLOB to the Android SQLite database?
I can see only methods for simple filetypes: String, Int, Double, Byte,...
In my case, i want to put a drawable or bitmap to my database. It starts like this:
Using java Syntax Highlighting
- [...]ContentValues values = new ContentValues();
- values.put(Scheme.Images.IMAGE_ID, imageId);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream out;
- try {
- out = new ObjectOutputStream(bos);
- out.writeObject(myImage);
- } catch (IOException e) {
- e.printStackTrace();
- }
- values.put(Scheme.Images.THUMB_DATA, bos.toByteArray());
Parsed in 0.031 seconds, using GeSHi 1.0.8.4





