Question

I want to implement google leaderboards in my game. Google says that i need to use BaseGameActivity but I am using AndEngine and its not based on the same BaseGameActivity.

At googles website its written that if i do not use BaseGameActivity i should use GameHelper.

mHelper = new GameHelper(this, GameHelper.CLIENT_ALL);

But GameHelper class is not resolved. Do you know which library i should implement and how should i implement to get the GameHelper class working

Was it helpful?

Solution

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

The integration is explained here. First you need to import it as a project inside eclipse and then add it to your project as a library.

It also contains the GameHelper class. if you dont want to use BaseActivity, you can just check out BaseActivity source code and add relevant code to your own activity. It basically initializes the GameHelper object in onCreate and call its lifecycle methods in onStart onPause etc.

Google itself has guide for it as a separate section here https://developers.google.com/games/services/android/init#using_gamehelper_without_basegameactivity

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top