I'm programming a simple game to learn Google Play Game Service. After playing the game, the user will get a score. I want to get information about old high scores (to compare with recent score), or whether I get new high rank in my circle or not, or what achievement I unlocked. So, please help me how to get this information.
-
1It's messy, but you could get all the archievements that are unlocked & and the highscore at the beginning of the game and get them after the game has finished. Then you just have to compare them – Mdlc Jun 29 '13 at 17:36
-
I can not find API to get these information. Can you send me documents about this function. Thank. – huynguyen Jun 30 '13 at 06:55
-
Try: http://developer.android.com/reference/com/google/android/gms/games/package-summary.html and http://developer.android.com/reference/com/google/android/gms/games/leaderboard/package-summary.html – Mdlc Jun 30 '13 at 08:45
2 Answers
You can download achievement information as in this answer.
I believe that a similar way can be used to obtain leaderboard data with getGamesClient().loadLeaderboardMetadata()
-
1On Android Google caches this information so it is safe to call repeatedly. – Goose Feb 16 '14 at 17:50
AFAIK Google Play Game Services is not intended to work like this. The basic idea is that you submit achievements and scores to GPGS and it then does the rest. The user gets the information he/she is interested in by looking at the relevant achievement/leaderboard. If you really need to track and display all this information in your app then maybe you should implement your own system instead of using GPGS?
One important design consideration with GPGS is to avoid unnecessary API calls from your app (presumably because this costs Google money). If you were to query leaderboards and achievements in your app (say every second or minute) then the number of API calls each time your game was played could easily increase from a handful to hundreds or even thousands per play.
To get a better understanding of how Google would like you to use Google Play Game Services I recommend that you read the documentation and watch this recent video made by the GPGS team
: Top 7 Google Play game services setup mistakes — Google Developers

- 3,489
- 1
- 20
- 24