I am having problems with reseting a particular table in SQLite. This table contains more than 2000 rows and I need to update it each time I launch the app. As the data I have to put is not always the same, I think the best I can do is reset the whole table and add the 2000 rows again. The problem is that it takes to much time. I've tried everything but the time it needs to work is still to much.
Does anyone know a better way for doing this?
Here is the code for reseting the table that is working best for me:
public void resetSearchableTable(){
SQLiteDatabase db = this.getWritableDatabase();
db.execSQL("DELETE FROM "+TABLE_SEARCHABLE_COINS);
}
Here is how I use it every time:
db.resetSearchableTable();
//add coins to db
for (Coin coinInList : listCoins) {
db.addSearchableCoin(coinInList);
//Log.d("searchable coin ", coinInList.getName() + " " + coinInList.getShortName());
}