Snapshot
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
Data object representing the data for a
saved game.
Data interface for a representation of a saved game. This includes both the metadata and
the actual game content.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From interface
com.google.android.gms.common.data.Freezable
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Methods
Retrieves the metadata for this snapshot.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eSnapshot\u003c/code\u003e is a data interface representing a saved game, including metadata and game content.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access the snapshot's metadata (\u003ccode\u003egetMetadata()\u003c/code\u003e) and content (\u003ccode\u003egetSnapshotContents()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSnapshotContents\u003c/code\u003e allows updating the snapshot data, but it might be null if the snapshot wasn't opened for writing.\u003c/p\u003e\n"],["\u003cp\u003eThe interface inherits methods for freezing data (\u003ccode\u003efreeze()\u003c/code\u003e), checking data validity (\u003ccode\u003eisDataValid()\u003c/code\u003e), and parceling for inter-process communication (\u003ccode\u003edescribeContents()\u003c/code\u003e, \u003ccode\u003ewriteToParcel()\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# Snapshot\n\npublic interface **Snapshot** implements [Freezable](/android/reference/com/google/android/gms/common/data/Freezable)\\\u003c[Snapshot](/android/reference/com/google/android/gms/games/snapshot/Snapshot)\\\u003e [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \n\n|---|---|---|\n| Known Indirect Subclasses [SnapshotEntity](/android/reference/com/google/android/gms/games/snapshot/SnapshotEntity) |-------------------------------------------------------------------------------------------|-----------------------------------------------------| | [SnapshotEntity](/android/reference/com/google/android/gms/games/snapshot/SnapshotEntity) | Data object representing the data for a saved game. | |||\n\nData interface for a representation of a saved game. This includes both the metadata and\nthe actual game content. \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [SnapshotMetadata](/android/reference/com/google/android/gms/games/snapshot/SnapshotMetadata) | [getMetadata](/android/reference/com/google/android/gms/games/snapshot/Snapshot#getMetadata())() Retrieves the metadata for this snapshot. |\n| abstract [SnapshotContents](/android/reference/com/google/android/gms/games/snapshot/SnapshotContents) | [getSnapshotContents](/android/reference/com/google/android/gms/games/snapshot/Snapshot#getSnapshotContents())() Retrieve the [SnapshotContents](/android/reference/com/google/android/gms/games/snapshot/SnapshotContents) associated with this snapshot. |\n\n### Inherited Method Summary\n\nFrom interface com.google.android.gms.common.data.Freezable \n\n|----------------------------------------------------------------------------------------|---------------|\n| abstract [Snapshot](/android/reference/com/google/android/gms/games/snapshot/Snapshot) | freeze() |\n| abstract boolean | isDataValid() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nPublic Methods\n--------------\n\n#### public abstract [SnapshotMetadata](/android/reference/com/google/android/gms/games/snapshot/SnapshotMetadata)\n**getMetadata** ()\n\nRetrieves the metadata for this snapshot. \n\n##### Returns\n\n- The [SnapshotMetadata](/android/reference/com/google/android/gms/games/snapshot/SnapshotMetadata) associated with this snapshot. \n\n#### public abstract [SnapshotContents](/android/reference/com/google/android/gms/games/snapshot/SnapshotContents)\n**getSnapshotContents** ()\n\nRetrieve the [SnapshotContents](/android/reference/com/google/android/gms/games/snapshot/SnapshotContents)\nassociated with this snapshot. This object can be used to update the data of a\nsnapshot. Note that this will return null if this snapshot was not obtained via\n[SnapshotsClient.open(SnapshotMetadata)](/android/reference/com/google/android/gms/games/SnapshotsClient#open(com.google.android.gms.games.snapshot.SnapshotMetadata)). \n\n##### Returns\n\n- The [SnapshotContents](/android/reference/com/google/android/gms/games/snapshot/SnapshotContents) for this snapshot, or null if the snapshot is not opened."]]