I am a programming noob writing a relatively large application for Android using Java code. The app is basically a game in which each user has a team with multiple players. Up until this point I have been using saved instance state and class instance variables to save game progress / player stats, but now that the app is almost completely written I have foolishly only just decided to learn & incorporate an SQLite database so that a users progress can be saved and resumed even after exiting the app. [sigh]
My question is simply for someone to explain the pros and cons of the following please:
updating each instance variable (and there are a lot of them) individually as the program runs. (I am just delving into learning about SQLite databases, but I gather the impression that constantly calling the cursor and writing/reading data from a database will be noticeably slower than how it ran originally with just instance variables and saved instance states) is this true?
Find a convenient place to update the entirety of the database all at one time (Again this is a pretty decent sized app and i fear that maybe waiting to save everything to the database upon exit will present a very noticeable lag) am I wrong?
Should I update the database at random periodic intervals? (would the best solution be to update all instance variables to the database every time a user changes activities (or something similar ) here-by lessening the database write time at least some so that when the database gets inevitably updated upon exit, it won't have as huge a lag time)
I would really like to have an idea of this before I basically have to overhaul my entire app to incorporate SQLite. I would much appreciate a suggestion on the best route to go. Thank you!