samedi 7 novembre 2015

Is it good practice to constantly update a database in an Android app?

I'm creating an android scoreboard app where the users update their scores and can view them later along with some stats, etc. Now, every time the user interacts with the app (presses a button), the score updates.

Should I update the SQLite database with every click the user performs? (since the user can choose to exit the app at any time but when he/she comes back the scores and data should still be there) or should I update the database only when each game is over?

Obviously, the first choice makes more sense to me but what would be the best way to implement it? Also, is it good practice to constantly be updating a DB? Should I use background threads? Should I back the data to a server or keep it local (in case the app is deleted)? (This is my first time creating an Android app and first time ever working with databases - so I don't know what the best practices are).

Aucun commentaire:

Enregistrer un commentaire