2

I found this tutorial for implementing the sign in and also the google play achievements.

The problem is that it shows me that I have to extend the BaseGameActivity class,but I'm already extending AndroidApplication.Oh and I am using LibGdx if it matters.

Khalil Khalaf
  • 9,259
  • 11
  • 62
  • 104
The Prophet
  • 147
  • 1
  • 4
  • 13

2 Answers2

0

For the achievement, you can use com.google.android.gms.games.achievement.

If you haven't done with it, you can follow the instructions for installing and setting up your app to a Google Play games services. Define the achievements that you want your game to unlock or display. Achievements can be a great way to increase your users' engagement within your game. You can implement achievements in your game to encourage players to experiment with features they might not normally use, or to approach your game with entirely different play styles.

To create an achievement, just go to Google Play Developer Console. Select the Achievements tab and click the Add Achievement. Then, simply fill out the information required for this achievement. Click Save, and your achievement will be made available in "Ready to publish" mode. Once you publish your game, all of your game's achievements will be published with it.

your game needs to implement user sign-in to authenticate your player's identity with the Google Play games services. If the user is not authenticated, your game will encounter errors when making calls to the Google Play games services APIs.

In order to sign players in, you will need to properly instantiate GoogleApiClient in your Activity by following the instructions in Accessing the Games APIs.

Check this documentation, this documentation describes some sign-in implementation techniques that your game can use to provide a seamless user experience.

Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30
0

That tutorial is out of date and I suggest you do not use it.

It is no longer necessary to extend BaseGameActivity. See

Android Game Leader Board: Where to extends BaseGameActivity?

and https://www.youtube.com/watch?v=1oSoaFLuTwM for further information.

The google documentation and samples are up to date, very clearly written and accurate and I recommend you start here:

https://developers.google.com/games/services/

Community
  • 1
  • 1
IanB
  • 3,489
  • 1
  • 20
  • 24
  • Does my game have to be published to connect with google play services? – The Prophet Jul 21 '16 at 14:50
  • I am getting this error when i try to mGoogleApiClient.connect on emulator: java.lang.NoSuchMethodError: No direct method – The Prophet Jul 22 '16 at 18:10
  • That is a different issue and I suggest that you provide full information in a new question. However I suggest you first look at this : http://stackoverflow.com/questions/14536595/how-to-download-google-play-services-in-an-android-emulator. – IanB Jul 22 '16 at 20:06