We are developing an Android App based on a product that already has a website. As a result, when launching the Android app it may happen that a lot of things differ between the local SQLite database and our central database.
What is the fastest way to synchronize the Android App?
- Compare the data in our central database with the SQLite database and update/insert/delete accordingly (for each table)?
- Or just drop the concerning tables and create them again - and execute a transaction with compiled statements?
Sounds like the first option may be very slow.
Any help would be appreciated!
Best How To :
In your case needs value the situation!! When I have this problems the first questions are...
The tables that I want to do 'drop table' have few data? If it's yes the best way is the 'drop table' command. If it's no then you need to use the 'insert' and 'update' commands. I need to remark that it's possible that the SQLite database grows with time, then the good programmer would second way because it's more secure and you think with future possibilities.
My app syncs any time or syncs a few times a day? If the answer is in any time then you need use the 'insert' and 'update' commands. Because you can't delete database tables every minutes or seconds.
Tell me if I helped you and good programming!