I’m doing both an update and an insert to a review_schedule table. It seems as if the time for the both takes between 1 and 2 seconds, which is a bit slow. I’ve tried it with and without indexes set on the id field and the date_review field. Note that I’m using a precompiled statement for the insert, but not the update, because the compiled statement for update apparently isn’t supported in Gingerbread. Here’s the code:
public long insert(int id, String lastReviewDate, String nextReviewDate) {
this.insertStmt.bindLong(1, id);
this.insertStmt.bindString(2, lastReviewDate);
this.insertStmt.bindString(3, nextReviewDate);
return this.insertStmt.executeInsert();
}
public void updateSRSInfo(int id, String lastReviewDate,
String nextReviewDate) {
ContentValues contentValues = new ContentValues();
contentValues.put("last_review_date", lastReviewDate);
contentValues.put("next_review_date", nextReviewDate);
this.myDataBase.update(DataBaseHelper.WORD_REVIEW_SCHEDULE,
contentValues, "_id=?", new String[] { Integer.toString(id) });
}
Any suggestions appreciated.
If the length of the procedure making the App unresponsive, maybe you can move the operation into a different thread.