I have e following codes to add a single entry into the database. However it takes more then 5 sec for the insertion to complete. I have tried using transaction as well and the performance is marginally better. Is there a way to speed up the insertion time ?
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put("name", username);
db.beginTransaction();
Log.e(TAG,"START");
// slow insertion
db.insert("user", null, values);
Log.e(TAG,"END");
db.setTransactionSuccessful();
db.endTransaction();
db.close();
The 5 sec i observed is from the logcat ouput.
Thanks.