Save data to cloud in android game

早过忘川 提交于 2019-12-12 09:15:22

问题


I'd like to save some data (just a few Integers) to the the cloud in an android game. The data represents the ingame currency, so its critical the user cant delete or manipulate the data himself. I already use google play services for multiplayer, leaderboards etc.

I'm a little bit confused by the amount of services google provides for saving data to the cloud, so maybe someone can clear things up a bit for me.

If im not mistaken these services dont fit my needs:

  • Google Saved Games (Snapshot)
  • Google Play Services AppState
  • Google Backup Api

It seems they all can be managed by the user, so he has control over that data.

So i stepped across alot of other google services, but im not quiet sure what each is doing exactly:

Google Datastore

Google App Engine

Google Cloud Save

As i understand it, the datastore represents a nonSQL database, which is managed by the Google App Engine. Google Cloud Save is the service i can use to handle the app engine. All without any need of writing backend code. But it seems the cloud save is not yet officially available.

So what id like to know, is if im on the right track with these assumptions. I'm just trying to save 3-5 integer values which are not managable by the user but are synced across devices even when the app is uninstalled or the app data is deleted manually. So maybe this all isnt needed and theres an easier way of solving it. So what would be my next step? Register for the cloud save trial, or can i handle the problem in an easier way?

Thx in advance


回答1:


As far as I know, Google Saved Games(Snapshots) can be used to accomplish your goals. I think user can only manage it if you let him by code(for example getting the snapshot from the result of the Google prefab Intent for snapshots), there are methods to get a single snapshot by tag(String), for a single user (GoogleApiClient connection). Besides Google suggest you to use Snapshots for this purpose instead of using Cloud Save as is said on the top of this link (yellow box where says: important!)

Also There's a way how to handle a possible multi-device access conflict.

Hope that it helped



来源:https://stackoverflow.com/questions/26464096/save-data-to-cloud-in-android-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!