I have a problem regarding inserting objects to a SQLite database. My class, Case
looks like this:
public class Case {
String caseNumber;
int status;
String date;
Bitmap rightIndexFinger;
Bitmap leftIndexFinger;
public Case(String caseNumber, int status, String date, Bitmap rightIndexFinger, Bitmap leftIndexFinger) {
this.caseNumber = caseNumber;
this.status = status;
this.date = date;
this.rightIndexFinger = rightIndexFinger;
this.leftIndexFinger = leftIndexFinger;
}
public Case(String caseNumber, int status, String date) {
this.caseNumber = caseNumber;
this.status = status;
this.date = date;
}
public Bitmap getRightIndexFinger() {
return rightIndexFinger;
}
public void setRightIndexFinger(Bitmap rightIndexFinger) {
this.rightIndexFinger = rightIndexFinger;
}
public Bitmap getLeftIndexFinger() {
return leftIndexFinger;
}
public void setLeftIndexFinger(Bitmap leftIndexFinger) {
this.leftIndexFinger = leftIndexFinger;
}
public String getCaseNumber() {
return caseNumber;
}
public void setCaseNumber(String caseNumber) {
this.caseNumber = caseNumber;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getDate() {
return date.toString();
}
public void setDate(String date) {
this.date = date;
}
}
I need to insert objects of this class into a SQLite database. What I tried is:
String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CASES + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + DATE + " TEXT,"
+ RIGHTFINGER + " TEXT," + LEFTFINGER +" TEXT" + ")";
db.execSQL(CREATE_CONTACTS_TABLE);
This make sense if all of my variables in the case
class was String
, but how can I do this for Bitmaps?