I am nearly finished with my Android game, but I want to make sure my save format is good. I am working on a fairly large game, so data such as high scores, stars, etc. are stored for around 80 levels, along with data for purchased items. Currently I save this data sequentially in a binary file. So when I need to load it, I have to go through all of the previous data to get to the data that I actually need. It seems to work fine, but I question how well this format will hold up for game updates. Is this is a bad approach to take? I considered using SQLite, but after trying to implement it into my game it didn't seem very effective. Updates seem as if they would be even more complicated.
How much is all your data? If all your achievements and stars fit within 1 MB, you'll be pretty much safe to save all this in one binary blob.
I would avoid easily-readable formats like XML, because this allows your players to read and edit anything they like, like getting through levels and get the stars they don't deserve.
Something like binary format, compressed with
zip if you care about the size and encrypted if you care about the security would work just perfectly.
A human-readable format like XML would likely make debugging the data easier. However, binary data is generally much faster. It really depends on how often you are reading and writing the data, and how much data you are loading and saving.
If you have a small amount of data, you should just consider keeping all of the data in memory while the game is running and only reading from the file when the app is started.