How to get image saved in Sqlite table?
the table is as follows:
public class ImageInDB extends SQLiteOpenHelper { private static final int DATABASE_VERSION = 2; private static final String DATABASE_NAME = "test01.db"; private static final String MP_TABLE_NAME = "MPImage"; ImageInDB (Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); }
Now, how should a method that extracts an image llok how ?? below is my attempt:
public ??? getMP_RPY(long id) { SQLiteDatabase db = this.getReadableDatabase(); SQLiteCursor c = (SQLiteCursor) db.rawQuery("SELECT img FROM MPImage WHERE "+ BaseColumns._ID+" = "+ Long.toString(id), null); c.moveToFirst(); ???? r = c.getDouble(0); return r; }
user1125258
source share