Google Play Games, backing up data, Drive deprecated - android

I'm just coming to the end of writing my first game, last thing to do is enable backing up the user's game. I have leaderboards and achievements implemented fine, and all Google's docs say I should be saving games to Drive using .requestScopes(Drive.SCOPE_APPFOLDER) which upon trying leads me to find that it's no longer going to work in 2 months.
Digging further, I found this line from Google: "Support for storing and syncing in the app data folder will likely be removed from Drive in the future."
I'm still learning all this as I go, and I'm using Kotlin (I don't know Java). Can anyone point me in the right direction to where I should be looking to backup users game data if the way Google suggests isn't going to work very soon?
Thanks

Google is deprecating the Google Drive Android API in favor of the Google Drive REST API. Here is the best starting point for implementing that in android that I could find.

Related

Images in Firebase Storage, how to get them to Google Drive Team Drive

I've built an app using Ionic that takes pictures and uploads them to Firebase Storage. What I'd like to do next is to make it so that the directory structure and images are accessible from a Google Team Drive.
What would be a good way to go about this? I don't have any code examples because I'm inexperienced with this and I don't really know where to start.
Would I write code to put in Firebase functions that would upload the images every X hours to a Google Accounts' Team Drive? Since Firebase Storage is just using Google Cloud anyways is there an API I could use? Does Firebase have this capacity already and I just don't know about it?
The Team Drive is under G Suite for my company so I could get a Google account made just for this purpose.
I'm new to Stack Overflow, sorry if this post breaks any rules.
https://github.com/firebase/functions-samples/tree/master/google-sheet-sync
This is the only example on the internet that I could find that addressed this issue.
It is a working (With a few tweaks as of Novemeber 2017) example of OAuth and Google's API for uploading information from the Database to a Google Sheets document via an onWrite() event trigger.
I managed to get this working, and in combination with the Google API docs and a lot of rummaging have sort of managed to get Google Drive connected.
The key points are:
-Follow the Firebase Functions examples
-Examine the google-sheets-sync example
-Firebase Functions takes node.js javascript
Posting this answer because it sounds simple but this was a hell of a lot of digging for me to find this all.

Using Saved Games API and Turn-Based Multiplayer API

On the Google Play Games Services developer website, it says:
Warning: Using the Saved Games API together with the turn-based multiplayer API could cause version conflicts because the save game and match data are not updated synchronously. To avoid these conflicts in your game, pick and use just one API to save your game state.
I am working on a game where I plan to use both APIs, and I'm curious if I will experience a conflict. I am creating a turn-based strategy RPG, where you can have multiple battles going on with friends (using the Turn-Based Multiplayer API). At the end of each battle, your character and soldiers earn XP and items. These are going to be saved using the Saved Games API. The two APIs won't need to interact at all.
Should I be concerned about this warning?
I would say yes, because it is coming from the Google itself. They put this warning to notify the developer that if they use Saved Games API and turn-based multiplayer API resulting in an error, these two API's will be the reason for that error and the developer can easily identify the cause of it. So they recommended that you need to pick and use just one API between the two to save your game state and avoid any error or conflicts in your game. Hope it helps you.

Unity Social API

We are writing an application in Unity3D for both iOS and Android and we'd like to use the provided Social API to retrive and post the highScores on iOS (using GameCenter) and Android (using Google Play Game Services).
To keep the application simple, its weight low and to avoid cross-compilation extra setups we'd prefer not to use external plugins (unless point 4 is true).
I googled around for documentation and tutorials and I found THIS ONE.
The implementation has been done in C#, but since the Unity guide also provides a c# version it went all straight forward.
However we couldn't manage to get this work, probably also because we don't understand well how this API really work.
First of all: the Unity guide states that "It [the api] provides a unified interface to different social back-ends, such as XBox Live or GameCenter", but in the implementation is not specified which social back-end is being used. How unity knows that? It switches depending on the platform?
Second: I understood in various guides that the GUI provided to show the leaderboard is directly provided by the host platform and from the console log i get these following success messages:
Authenticated, checking achievements
Error: no achievements found
Successfully reported achievement progress
but running the application in the editor, in a build made for windows or an apk used in BlueStacks, i get the same message when I call the function Social.ShowLeaderboardUI(); which is
ShowLeaderboardUI not implemented
I could expect it from the editor and the exe, but BlueStack emulates Android and i would be surprised if it doesn't provide the google play services. However i also read about a "sandbox mode" which is the one that should run in the editor and this leads to point three:
I can't find a way to set this sandbox mode, at least not from that guide.
Fourth point: Unity has a GameCenter class, but no classes for the Google Play Games Services, so: I can do what I want with iOS but I need an external plugin which implements the ISocial interface for Android?
Fifth point: How do i handle authentication in both sandbox and deploy mode?
As you can see I'm surely missing something on the coding side, conceptual side or both. Can you provide a step-by-step procedure on how to achieve what i need? I don't need to get pieces of source code, but if someone can explain me well how this API works it would be great.
Thanks in advance
For Android:
To integrate Google Play Service into Unity, you need to use a plugin. You can find the Google supported plugin here. You can find information on how leaderboards work here. Essentially how it works is:
You create the leaderboard in the Google Play Developer Console
You submit scores to the leaderboard created (at whenever you determin is the appropriate time)
Google Play Services sends a response back telling if it's a high score or not.
I suggest you take a look at the Cubic Pilot_4.6 sample as that demonstrates how to implement leaderboards. Also, you really ought to test this on a physical device, due to how emulators may have trouble handling Google Play Services and account logins.
As far as authentication goes, Google Play Services takes care of most of it for you. You can probably see more in the samples (Social.localUser.Authenticate).
Current implementation does only provide implementation for GameCenter and XboxLive. There's a property Social.Active which can be used to modify what social platform is used. You can set a object which implements ISocialPlatform but im not sure if that interface is fully open - thus, im not sure if anyone can implement that..

Can you use Google Play Games API in apps other than games?

I want to add achievements to my app. I started doing such my way, but after the last release, with the new Games API, I've seen it looks clearly better than coding all by myself. What I don't know if there are clauses that avoid using the Game API for regular apps rather than games.
PS: I've checked twice the Games Services website, but nothing appears there.
I don't see any problem with that!
This concept is called gamification:
http://en.wikipedia.org/wiki/Gamification

Does Google Drive integrate with Android through code?

I have spent some hours searching for Android phone integrations with Google Drive through code. But I am not able to figure it out. I want to make a app in which when I press a button, my specific file is uploaded and stored in Google Drive.
Currently, GoogleDrive is not integrated with Android. However, this is something they are working on and say it will be here "soon". The services theyre working on is called Google Play Services.
You can also currently use the java client library to accomplish what you need for now.
Just a warning, there aren't many great examples out there so its somewhat difficult to figure out.

Categories

Resources