There are few questions related to this topic on stackoverflow, But I didn\'t get the proper answer. I have some doubts on performance of flat files, Is it better to use flat fi
I believe you are inserting 1000 or 10000 using a loop. Use TRANSACTIONS , it will dramatically reduce the write time. I already encountered such an issue and it reduced the write time in my case from around 30 seconds to about less than 1 second.
Take a look at this.
Basically, what you should do is :
db.beginTransaction();
try{
for(int i = 0 ; i < LENGTH ; i++ ) {
// execute SQL
}
db.setTransactionSuccessful(); // marks a commit
}
finally{
db.endTransaction();
}