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 \" +
Try this one
InputStream is = mycon.getAssets().open("data/Images/img1");
if (is.available() == -1) {
Log.v(null, "Images not read to Input stream");
}
if (is != null) {
BufferedInputStream bis = new BufferedInputStream(is, 128);
ByteArrayBuffer barb = new ByteArrayBuffer(128);
// read the bytes one by one and append it into the
// ByteArrayBuffer barb
int current = 0;
while ((current = bis.read()) != -1) {
barb.append((byte) current);
}
values.put("imageData", barb.toByteArray());