简体   繁体   中英

How to use Google Snapshot Api to store app data online?

I'm working on a fighting game with many characters to unlock and I'm trying to store each user app data online so if they reinstall the app they can get their save data back again. The game saves in-game currency and some other data using SharedPreferences and saves the data of each character in a database using SQLite . Now I'm trying to use Google Snapshot Api but there are 2 problems:

  • first I'm not sure how to store both of these data, I followed the documentation but I'm stuck at the part where I'm supposed to pass byte[] bytes to snapshot.getSnapshotContents().writeBytes(bytes); .
  • second does this approach store the entire game data every time it's called, like every time I want to save the new amount of the in-game currency does that mean that I have to store the database again? or can it update the amount only.

You may Refer any preferable back-end server for storing data online

  • PHP with MySQL

  • Firebase cloud storage

  • Use Web Services in any of this language Php, .Net, Java, etc.

I personally using PHP-MySQL and Fire-base

refer Following links:

https://www.tutorialspoint.com/android/android_php_mysql.htm

https://developer.android.com/studio/write/firebase

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM