I have two queries:
I want to insert the data from the web services into the local SQLite DB. I want to insert this data only once then the next time it will not loaded from the web services. I have tried using Static variable but that didn't worked.
static int UpdateOneTime=0;
if (UpdateOneTime==0) {
getData();
UpdateOneTime++;
}
If I want to reload the data again means when app start every time it will get the data from the server and insert into the DB by just deleting the previous data in the table. I have tried by just calling the
onUpgrade(SqliteDatabase db, int oldversion,int newversion);
But it didn't worked. So how to solve these two issues. Suggest me something.