I have been doing some experiments to measure sqlite performance on android. I was disappointed a little bit with the results. What i did was inserting 10.000 queries to ta
You can use SQL transactions in Android like this. It's better to insert multiple rows into the database in larger batches then making single commit (write into SQLlite datafile which is very slow) for every inserted row.
public void insert(List students)
{
SQLiteDatabase db = sh.getWritableDatabase();
ContentValues cv = new ContentValues();
db.beginTransaction();
try {
for (Student s : students) {
cv.put(StudentHelper.FIRSTNAME,s.getFirstName());
cv.put(StudentHelper.LASTNAME,s.getLastName());
cv.put(StudentHelper.ADDRESS,s.getAddress());
cv.put(StudentHelper.GPA,s.getGpa());
db.insertOrThrow(StudentHelper.TABLE_NAME, null, cv)
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}