I want to know how to save a bitmap in database. I created table in db as:
@Override
public void onCreate(SQLiteDatabase db)
{
db.execSQL(\"CREATE TABLE \" +
If you have Bitmap image then you can do following.
Bitmap photo =
ByteArrayOutputStream bos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.PNG, 100, bos);
byte[] bArray = bos.toByteArray();
Then you can save data in table using following way.
db = YourDBHelper.getInstance(ctx).getWritableDatabase();
ContentValues values = new ContentValues();
values.put("image", bArray);
db.insert(TABLE_NAME , null, values);