-2

I am developing an android game in that I want to keep the user completed stage even the user update the game to new version. For example If the user completed five levels in the game and the new version of the game is released user updated the game and he starts means the user again want to start from the level five.

Please give me an idea how to do this. Thanks in advance

Krishna
  • 4,892
  • 18
  • 63
  • 98

3 Answers3

1

The first thing that comes to mind would be to store some value inside SharedPreferences http://developer.android.com/reference/android/content/SharedPreferences.html http://developer.android.com/training/basics/data-storage/shared-preferences.html

Or perhaps use SQLite to store the values, and query them when the game starts to put the user back on to the correct level/progress.

Nick H
  • 8,897
  • 9
  • 41
  • 64
1

Try to save the data in Sqlite database, so when the user upgrades the app its -

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // do your stuff
}

gets called, you can check for old and new version number and handle the case on your own.

Hope this helps.

Ashish Tamrakar
  • 810
  • 10
  • 24
0

The standard and best way to store game progress is by using Google play game services.

The Saved Games service gives you a convenient way to save your players' game progression to Google's servers. Your game can retrieve the saved game data to allow returning players to continue a game at their last save point from any device.

The main advantage of using Google play game service is, it makes it possible to synchronize a player's game data across multiple devices.

Check and read more: Saved Games

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295