Android APIs
public final class

CloudSaveManager

extends Object
java.lang.Object
   ↳ com.google.android.gms.cloudsave.CloudSaveManager

Class Overview

Main public API entry point for the CloudSave APIs.

Summary

Nested Classes
interface CloudSaveManager.DeleteResult Result of a delete request using delete(GoogleApiClient, Query)
class CloudSaveManager.Options Options for using the CloudSave API. 
interface CloudSaveManager.QueryResult Result of a query request using query(GoogleApiClient, Query)
interface CloudSaveManager.SaveResult Result of a save request. 
Fields
public static final Api<CloudSaveManager.Options> API Token to pass to addApi(Api) to enable CloudSave features.
public static final Scope SCOPE_CLOUD_SAVE Scope for using the CloudSave Service.
Public Methods
static PendingResult<CloudSaveManager.DeleteResult> delete(GoogleApiClient googleApiClient, Query query)
Delete an entity from local CloudSave db and asynchronously replicate the delete to the server.
static Entity.Key generateEntityKey(GoogleApiClient googleApiClient, String kind, String name)
static PendingResult<CloudSaveManager.QueryResult> query(GoogleApiClient googleApiClient, Query query)
Query entity for given workspace & user from local database.
static PendingResult<Status> requestSync(GoogleApiClient googleApiClient)
Request a sync of local database with remote server.
static PendingResult<CloudSaveManager.SaveResult> save(GoogleApiClient googleApiClient, Collection<Entity> entities)
Save a collection of Entities to local CloudSave db and asynchronously replicate the update to the server.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Api<CloudSaveManager.Options> API

Token to pass to addApi(Api) to enable CloudSave features.

public static final Scope SCOPE_CLOUD_SAVE

Scope for using the CloudSave Service.

Public Methods

public static PendingResult<CloudSaveManager.DeleteResult> delete (GoogleApiClient googleApiClient, Query query)

Delete an entity from local CloudSave db and asynchronously replicate the delete to the server.

Required API: API
Required Scopes: SCOPE_CLOUD_SAVE

Parameters
googleApiClient The GoogleApiClient to service the call.
query The Query object that specifies which Entity objects are supposed to be deleted.
Returns

public static Entity.Key generateEntityKey (GoogleApiClient googleApiClient, String kind, String name)

public static PendingResult<CloudSaveManager.QueryResult> query (GoogleApiClient googleApiClient, Query query)

Query entity for given workspace & user from local database. If the application is reading data for the first time, the app data may not have been synced with remote server yet. If there is network connectivity then CloudSave tries to pull data from server, otherwise an error status is returned.

Required API: API
Required Scopes: SCOPE_CLOUD_SAVE

Parameters
googleApiClient The GoogleApiClient to service the call.
query The Query to fetch Entity objects.
Returns

public static PendingResult<Status> requestSync (GoogleApiClient googleApiClient)

Request a sync of local database with remote server. If a sync was successfully completed then the result returns a success status. Otherwise a relevent error status is returned.

Required API: API
Required Scopes: SCOPE_CLOUD_SAVE

Parameters
googleApiClient The GoogleApiClient to service the call.
Returns

public static PendingResult<CloudSaveManager.SaveResult> save (GoogleApiClient googleApiClient, Collection<Entity> entities)

Save a collection of Entities to local CloudSave db and asynchronously replicate the update to the server. The remote update can take a long time depending on network connectivity and performance related optimizations.

Required API: API
Required Scopes: SCOPE_CLOUD_SAVE

Parameters
googleApiClient The GoogleApiClient to service the call.
entities A Collection of Entitys to be saved.
Returns