I’ve got some basic Java experience and very basic Android app development experience (currently reading Android Wireless Application Development Volume I).
I’m trying to develop an android app to keep track of Beer Pong statistics (shooting percentage, win percentage, shooting streak, etc.). I want to be able to store this data so that I can display leaderboards within the app and also transfer the data to my computer for more complex statistical analysis and permanent tracking.
I’d appreciate some input on the best/easiest way to do this regarding…
1) What information to store?
I imagine I’d need to store user/player names and keep track of every single shot make/miss? What sort of format would be effective?
2) When to store it?
Should I “commit” these makes/misses to storage after each shot? Or at the end of the game? I would like to implement a ‘back’ or ‘undo’ button to account for mistakes. How would this affect when I should store the data?
3) How to store it?
Based on my limited android app development experience, would SQLite databases be easy to learn and appropriate? Would storing to a google excel doc be easy (requires constant internet connection, though)? Would some other form of storage be better?
Thank you and OSS!
An SQL database would be your best bet, and committing changes to the database on the fly is fine.
undo / redo is implemented best using the Command Object design pattern. The command objects can store the information needed to back out a transaction from your data source for the user action they are associated with. Simply push new command objects onto the stack each time the user performs actions (storing details of their action in the command object), and then pop those command objects off the stack and call their revert method when the user hits undo. The revert method uses the stored data from when you created the object to back out the transaction from your SQL database.
Wiki Link for Command Pattern