Mar 27, 2016  Make your phone easier to use with one hand, no root. XDA Forum App. The best way to access XDA on your phone. Help & Troubleshooting Where are the game save files located on Android? By sprunknwn. Galaxy Note 3 Q&A, Help & Troubleshooting. All I had to do was download Helium on both of my phones and the desktop program. The Saved Games service makes it possible to synchronize a player's game data across multiple devices. For example, if you have a game that runs on Android, you can use the Saved Games service to allow a player to start a game on their Android phone, and then continue playing on a. But, when it comes to Play Windows Games On Android, you have to use Windows Emulator For Android or there are multiple methods using which you can Play PC Games On Android For Free. But, if you are using Windows Emulator, then you have to install Windows Games on your Android Phone which will consume much time and Phones Battery.

This guide shows you how to implement saved games game using thesnapshots API provided by Google Play games services. The APIs can be found in thecom.google.android.gms.games.snapshotand com.google.android.gms.games packages.

Before you begin

If you haven't already done so, you might find it helpful to review theSaved Games game concepts.

  • Make sure to enable saved games supportfor your game in the Google Play Console.
  • Download and review the saved games code sample in theAndroid samples page.
  • Familiarize yourself with the recommendations described inQuality Checklist.

Getting the snapshots client

To start using the snapshots API, your game must first obtain aSnapshotsClient object. You can do this by calling theGames.getSnapshotsClient() method and passing in theactivity and the GoogleSignInAccount for the current player. To learn how toretrieve the player account information, seeSign-in in Android Games.

Note: The SnapshotsClient class makes use of the Google Playservices Taskclass to return results asynchronously. To learn more aboutusing tasks to manage threaded work, see theTasks API developer guide.

Specifying the Drive scope

The snapshots API relies on the Google Drive API for saved games storage. Toaccess the Drive API, your app must specify theDrive.SCOPE_APPFOLDERscope when building the Google sign-in client.

Here’s an example of how to do this in theonResume()method for your sign-in activity:

Displaying saved games

Download Saved Games Files On Server For Android Phone

You can integrate the snapshots API wherever your game provides players withthe option to save or restore their progress. Your game might display such anoption at designated save/restore points or allow players to save or restoreprogress at any time.

Once players select the save/restore option in your game, your game canoptionally bring up a screen that prompts players to enter information for a new savedgame or to select an existing saved game to restore.

Saved

To simplify your development, the snapshots API provides a default saved games selection userinterface (UI) that you can use out-of-the-box. The saved games selection UI allows players tocreate a new saved game, view details about existing saved games, and load previous saved games.

To launch the default Saved Games UI:

  1. Call SnapshotsClient.getSelectSnapshotIntent() to get anIntent for launching the defaultsaved games selection UI.
  2. Call startActivityForResult()and pass in that Intent.If the call is successful, the game displays the saved game selection UI, alongwith the options you specified.

Here’s an example of how to launch the default saved games selection UI:

If the player selects to create a new saved game or load an existing saved game,the UI sends a request to Google Play games services. If the request is successful,Google Play games services returns information to create or restore the saved game throughthe onActivityResult()callback. Your game can override this callback to check if any errors occurred during request.

The following code snippet shows a sample implementation ofonActivityResult():

Writing saved games

To store content to a saved game:

  1. Asynchronously open a snapshot via SnapshotsClient.open(). Then, retrieve the Snapshot objectfrom the task's result by calling SnapshotsClient.DataOrConflict.getData().
  2. Retrieve a SnapshotContents instance via SnapshotsClient.SnapshotConflict.
  3. Call SnapshotContents.writeBytes() to store the player's data in byte format.
  4. Once all your changes are written, callSnapshotsClient.commitAndClose() to send your changes to Google's servers. In the method call,your game can optionally provide additional information to tell Google Play games services how topresent this saved game to players. This information is represented in a SnapshotMetaDataChangeobject, which your game creates using SnapshotMetadataChange.Builder.

The following snippet shows how your game might commit changes to a saved game:

If the player's device is not connected to a network when your app callsSnapshotsClient.commitAndClose(), Google Play games services stores the saved game data locally onthe device. Upon device re-connection, Google Play games services syncs the locally cached saved gamechanges to Google's servers.

Loading saved games

To retrieve saved games for the currently signed-in player:

  1. Asynchronously open a snapshot via SnapshotsClient.open(). Then, retrieve the Snapshot objectfrom the task's result by calling SnapshotsClient.DataOrConflict.getData(). Alternatively, yourgame can also retrieve a specific snapshot through the saved games selection UI, as described inDisplaying Saved Games.
  2. Retrieve the SnapshotContents instance via SnapshotsClient.SnapshotConflict.
  3. Call SnapshotContents.readFully() to read the contents of the snapshot.

The following snippet shows how you might load a specific saved game:

Handling saved game conflicts

When using the snapshots API in your game, it is possible for multipledevices to perform reads and writes on the same saved game. In the event that adevice temporarily loses its network connection and later reconnects, this mightcause data conflicts whereby the saved game stored on a player's local deviceis out-of-sync with the remote version stored in Google's servers.

The snapshots API provides a conflict resolution mechanism that presents bothsets of conflicting saved games at read-time and lets you implement a resolutionstrategy that is appropriate for your game.

When Google Play games services detects a data conflict, theSnapshotsClient.DataOrConflict.isConflict() method returns a value of true In this event, theSnapshotsClient.SnapshotConflict class provides two versions of the saved game:

  • Server version: The most-up-to-date version known by Google Play games services to be accuratefor the player’s device; and
  • Local version: A modified version detected on one of the player's devices that containsconflicting content or metadata. This may not be the same as the version that you tried to save.

Your game must decide how to resolve the conflict by picking one of theprovided versions or merging the data of the two saved game versions.

To detect and resolve saved game conflicts:

  1. Call SnapshotsClient.open(). The task result contains a SnapshotsClient.DataOrConflict class.
  2. Call the SnapshotsClient.DataOrConflict.isConflict() method. If the result is true, you have aconflict to resolve.
  3. Call SnapshotsClient.DataOrConflict.getConflict() to retrieve aSnaphotsClient.snapshotConflict instance.
  4. Call SnapshotsClient.SnapshotConflict.getConflictId() to retrieve the conflict ID that uniquelyidentifies the detected conflict. Your game needs this value to send a conflict resolution requestlater.
  5. Call SnapshotsClient.SnapshotConflict.getConflictingSnapshot() to get the local version.
  6. Call SnapshotsClient.SnapshotConflict.getSnapshot() to get the server version.
  7. To resolve the saved game conflict, select a version that you want to save to the server as thefinal version, and pass it to the SnapshotsClient.resolveConflict() method.

The following snippet shows and example of how your game might handle a saved game conflict byselecting the most recently modified saved game as the final version to save:

Modifying saved games for conflict resolution

If you want to merge data from multiple saved games or modify an existing Snapshotto save to the server as the resolved final version, follow these steps:

Android
  1. Call SnapshotsClient.open() .
  2. Call SnapshotsClient.SnapshotConflict.getResolutionSnapshotsContent() to get a newSnapshotContents object.
  3. Merge the data from SnapshotsClient.SnapshotConflict.getConflictingSnapshot() andSnapshotsClient.SnapshotConflict.getSnapshot() into the SnapshotContents object from theprevious step.
  4. Optionally, create a SnapshotMetadataChange instance if there are any changes to the metadatafields.
  5. Call SnapshotsClient.resolveConflict(). In your method call, pass inSnapshotsClient.SnapshotConflict.getConflictId() as the first argument, and theSnapshotMetadataChange and SnapshotContents objects that you modified earlier as the second andthird arguments respectively.
  6. If the SnapshotsClient.resolveConflict() call is successful, the API stores the Snapshotobject to the server and attempts to open the Snapshot object on your local device.
    • If there is a conflict, SnapshotsClient.DataOrConflict.isConflict() returns true. In thiscase, your game should return to step 2 and repeat the steps to modify the snapshot untilconflicts are resolved.
    • If there’s no conflict, SnapshotsClient.DataOrConflict.isConflict() returns false andthe Snapshot object is open for your game to modify.

The Saved Games service gives you a convenient way to saveyour players' game progression to Google's servers. Your game can retrieve thesaved game data to allow returning players to continue a game at their lastsave point from any device.

The Saved Games service makes it possible to synchronize a player's game dataacross multiple devices. For example, if you have a game thatruns on Android, you can use the Saved Games service toallow a player to start a game on their Android phone, and thencontinue playing on a tablet without losing any of their progress. This servicecan also be used to ensure that a player's game playcontinues from where it left off even if their device is lost, destroyed, ortraded in for a newer model.

Note: Before using the Saved Games service, you must firstenable it in theGoogle Play Console.

To learn how to implement saved games for your platform, seeClient implementations.

Saved Games basics

A saved game consists of two parts:

  • An unstructured binary blob - this data can represent whatever you choose,and your game is responsible for parsing and writing to it.
  • Structured metadata - additional propertiesassociated with the binary data that allow Google Play games services to visuallypresent Saved Games in the default Saved Games list user interface (UI), and topresent useful information in theGoogle Play Games app (for example, last updated timestamp).

A game can write an arbitrary number of Saved Games for a single player,subject to user quota, so there is no hard requirement to restrictplayers to a single save file.

Cover images

The Saved Games service provides a visual user experience in addition topersistence features. You are strongly encouraged to associate representativeimages with corresponding save files. If you are using the default Saved Gameslist user interface (UI) provides by the Play Games SDK in your game, the UIwill display these cover images. The cover images may also appear in theGoogle Play Games app.

Descriptions

You can provide a short text description of the content of a particular savedgame. This description is directly displayed to players and should summarizethe state that the saved game represents; for example, “Fighting the Goblinsin the Dark Woods”.

Quota

Developers are not charged for any saved game data that’s stored in the cloud.Instead, this data is counted against the player’s Google Drive quota - younever have to worry about it. The only quota that game developers need to careabout is their Google Drive API quota.

Read/Write isolation

All Saved Games are stored in your players' Google Drive Application DataFolder. This folder can only be read and written by your game - it cannot beviewed or modified by other developers’ games, so there is additional protectionagainst data corruption. In addition, Saved Games are insulated from directtampering by players so they cannot modify individual Saved Games.

Offline support

Your game can still read and write to a saved game when the player's device isoffline, but will not be able to sync with Google Play games services untilnetwork connectivity is established. Once reconnected, Google Play games servicesasynchronously updates the saved game data on Google's servers.

Conflict resolution

When using the Saved Games service, your game may encounter conflicts whenattempting to save data. These conflicts can occur when a user is running morethan one instance of your application on different devices or computers. Yourapplication must be able to resolve these conflicts in a way that provides thebest user experience.

Typically, data conflicts occur when an instance of your application is unableto reach the Saved Games service while attempting to load data or save it. Ingeneral, the best way to avoid data conflicts is to always load the latest datafrom the service when your application starts up or resumes, and save data tothe service with reasonable frequency. However, it is not always possible toavoid data conflicts. Your application should make every effort to handleconflicts such that your users' data is preserved and that they have a goodexperience.

Limits

Google Play games services currently enforce size limits on binary data and coverimage sizes of 3 MB and 800 KB respectively.

Saved game metadata

Download Saved Games Files On Server For Android Phone Pc

The structured metadata for a saved game contains these these properties:

PropertyDescription
IDA unique string generated by Google Play games services for this saved game. Use this ID to refer to the saved game in your game clients.
NameA developer-supplied short name for the saved game, for example 'Save slot 1' or 'PlayerName_Save1'. This is not shown to players.
DescriptionA developer-supplied description of the saved game.
Last modifiedTimestamp in milliseconds generated by Google Play games services for when the saved game was last updated.
Played timeA developer-supplied time (in milliseconds) to display on the saved game. This value should represent how long the player has played the corresponding save game. For example, a played time value of 3600000 will be displayed by Google Play games services as '1 hr'.
Cover imageThis is an optional, developer-supplied property that contains information about the cover image.

Download Saved Games Files On Server For Android Phone Iphone

Client implementations

Download Saved Games Files On Server For Android Phone Number

To learn how to implement Saved Games for your platform, see the following resources: