google-play-games

Google Play Game Services - not signed in on next activity

元气小坏坏 提交于 2019-12-06 12:20:28
问题 In my application, i have in game helper(i want log in on button click): // Whether to automatically try to sign in on onStart(). We only set this // to true when the sign-in process fails or the user explicitly signs out. // We set it back to false when the user initiates the sign in process. boolean mConnectOnStart = false; In my MainActivity (extends BaseGameActivity), after login button click i call: beginUserInitiatedSignIn(); Of course now isSignedIn() returns true. But when I go to

OAuth token with Google Play Game Services

匆匆过客 提交于 2019-12-06 12:10:28
问题 Is there a way to get the token that was used to log in the user with Google Play Game Services? I'm looking for something like: @Override public void onSignInSucceeded() { String email = getGamesClient().getCurrentAccountName(); String token = getGamesClient().getToken(); } I need this to authenticate the user when they are contacting my own server. 回答1: This is how I managed to get the token: @Override public void onSignInSucceeded() { String email = getGamesClient().getCurrentAccountName()

libGDX - Google Play Game Services in Android Studio

泄露秘密 提交于 2019-12-06 11:54:26
问题 After migrating to Android Studio from Eclipse, I was struggling at best with it. Problem was that most guides and tutorials you could find are for Eclipse , but if you can find one for Android Studio, it is missing most important parts - implementing libraries or 3rd party code. After week of problems and errors here is a guide 回答1: Requirements: Google play services and Google Repostory (under Extras in SDK manager), BaseGameUtils Firstly we need to add BaseGameUtils as Module: then select

When a peer disconected from a room in google play services

♀尐吖头ヾ 提交于 2019-12-06 10:09:06
What is the different between a peer dissconnected to a peer leaving a room. if a participent disconnect from a room, what would his status be? STATUS_JOINED or STATUS_LEFT? I'm working on a fairly long turn based game (should be a few minutes game) and i believe there would be alot of disconnecting cases that i would like to resolve. Would it be possible to resend an invitation to the disconnected user and get him back to the room? if the room creator got disconnected, and the previuse was possible, would he still be the creator of that game after reconnecting? The first caveat is that the

Test Google Play Games on app signed with upload key

本秂侑毒 提交于 2019-12-06 02:54:50
I am trying to test the functionality of google play games on the app I am currently building with Unity. I have opted for the Google's app signing and have access to only the upload Keystore. Is there a way to connect to google play games with a version of the app signed by the upload key so that I don't have to deploy my app everytime I want to test it? Though it's not the ideal workflow, you can upload an APK (signed with your upload key) to an internal or closed test track, and then download the Google re-signed APK when it's available from the test track. Unfortunately, even test track

Is it senseful and legal to use Google Play Game Services for Non-Game-Apps?

强颜欢笑 提交于 2019-12-06 02:52:23
Is it senseful and legal to use Google Play Game Services for anything else than a game? I think an app that can upload images could have leaderboards (weekly likes) and achievements. Or a language learning app could also use these features to make the learning process more fun. Why are there no apps using these features? Is it not allowed? Or is the problem, that the app would be listed as a game in the Play Store, even if it is not a game? Will Google ban such apps? 来源: https://stackoverflow.com/questions/30287139/is-it-senseful-and-legal-to-use-google-play-game-services-for-non-game-apps

libGDX Google Play Game Services - Android

ぐ巨炮叔叔 提交于 2019-12-06 02:37:56
问题 I am trying to implement Google play Game Services into libGDX project. In my android project, the MainActivity looks like this: public class MainActivity extends AndroidApplication implements GameHelper.GameHelperListener, ActionResolver { GameHelper gameHelper; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); gameHelper = new GameHelper(this, GameHelper.CLIENT_ALL); gameHelper.enableDebugLog(true); getWindow().addFlags(WindowManager

Changing the certificate fingerprint for an existing application

故事扮演 提交于 2019-12-06 01:29:39
I have an existing application that i published in to google play. All was fine, until I have changed a computer and my sha1 fingerprint changed. Is there a possible way to change the sha1 for an existing application in google play developer console? if not, how can I deal with it? Thank you! If you remember, when you publish the app first time on your older computer, you generate a key.keystore in order to sign the apk file and publish to google play. You need to have the same file. When you want to sign the apk, it asks if you want to generate a new key or use an existing key. Since you have

How to use BaseGameActivity.getApiClient() in multiple activities?

谁都会走 提交于 2019-12-05 08:08:46
In my game app I would like the user to sign in to Google Play Services during the starting activity so I had it subclass BaseGameActivity . Then a separate activity is started for the game, at the end of which I want to update a leaderboard using Google Play Services, which requires calling BaseGameActivity.getApiClient() . How should I use Google Play services from a different activity than the one that subclasses BaseGameActivity ? Two options I thought of were: pass a reference to the starting activity, or use a handler and send a message to the starting activity. But I don't know which

How to decide who is the first player when user plays quick game?

[亡魂溺海] 提交于 2019-12-05 05:24:42
I am using following code in onRoomConnected(int statusCode, Room room) for deciding who is the first player. But some times I am getting first/second for both players same. How to resolve this error. if (quickGame) { myTurn = room.getParticipants().get(0).getParticipantId().equals(myId); } else { myTurn = room.getCreatorId().equals(myId); } if (myTurn) { Log.e(TAG, "First Player"); status.setText("Click a button to start"); } else { Log.e(TAG, "Second Player"); status.setText("Wait for opponent to start"); } The set of participant IDs is guaranteed to be the same to everybody who is in the