Efficient batch SQL query execution on Android, for upgrade database Efficient batch SQL query execution on Android, for upgrade database sqlite sqlite

Efficient batch SQL query execution on Android, for upgrade database


How do I insert these efficiently?

Use transaction:

    db.beginTransaction();    try {        for(;;) {            db.execSQL(...);            }        db.setTransactionSuccessful();    } finally {        db.endTransaction();    }


I think what you have is the only way to load those 1000 records, now, as far as deploying that DB with your apk file, check out this post:

http://www.helloandroid.com/tutorials/how-have-default-database