I have a table with a Blob datatype column which saves profile pictures (small Drawlable
object).
Usually i would run the SqLiteDatabse.insert()
method with ContentValues
object so all the converting stuff wont be implement by me.
From my own reasons i need to use an "Insert or Replace"
Sqlite query and to insert the profile picture's Drawable using a String query so i will have to implement my own convertion from byte[]
to String
in order to use the SqLiteDatabse.rawQuery() method.
can you please provide a way of doing it manually and not using ContentValue
object ?
P.S
I can solve this by creating 2 queries:
- check if the raw exists
- if not - create it, if so - update it
and then i will be able to use the ContentValue
object conveniently. but it sounds really inefficient to do so...