Reputation: 2098
I'm developing simple android game with a menu and 3 stages of game. Currently I'm working on saving game state. In the menu activity user can change some settings such as audio(on/off), ads(on/off), etc. When the user presses "new game", therefore leaves menu activity for game activity:
1) Should I finish menu activity and restart it by intent every time user presses back button in the game? Keeping them both(menu activity and the game activity) alive gives OutOfMemory error.
2) Where I should save settings user changed in the menu?
Saving game state and android development is new to me, so I would appreciate detailed replies.
Upvotes: 0
Views: 837
Reputation: 3925
Your data storage options are the following:
source : developer.android.com
Upvotes: 1
Reputation: 705
One of the things Google is trying to push on game devs is their Google Play Game Services. You could solve your problem with it. If you don't want the added learning curve for that, you can save your settings using SharedPreferences. More information about storing data can be found here: data storage.
I highly recommend reading Google's Android developer documentation. A lot of questions are answered there.
Upvotes: 1
Reputation: 598
Using Preferences.
Here are some useful links that will help you doing this:
Upvotes: 1