Google Play Games Achievements System Development
Google Play Games Services provides ready infrastructure for achievements, leaderboards, and cloud saves. Achievements are probably the simplest integration in this stack: Google handles storage, UI, and sync between devices.
Setup in Play Console
Before writing code—setup in Google Play Console → Play Games Services → Setup and Management. Achievements are created there with IDs, icons, descriptions, and types (standard or incremental with step count). Achievement IDs look like CgkI...—Base64 strings to copy to res/values/games_ids.xml via "Get resources" button in Console.
App links to Play Games via OAuth. AndroidManifest.xml needs <meta-data> with com.google.android.gms.games.APP_ID.
Achievement Unlock Code
Dependency: com.google.android.gms:play-services-games-v2:19.0.0 (Play Games SDK v2, current version without legacy PendingResult API).
val gamesSignInClient = PlayGames.getGamesSignInClient(activity)
gamesSignInClient.signIn().addOnCompleteListener { task ->
if (task.isSuccessful) {
val achievementsClient = PlayGames.getAchievementsClient(activity)
// Unlock achievement
achievementsClient.unlock(getString(R.string.achievement_first_win))
// Incremental achievement (steps)
achievementsClient.increment(getString(R.string.achievement_veteran), 1)
}
}
unlock() can be called multiple times—re-unlocking already-completed achievement is ignored. increment() for incremental achievements adds steps; when enough accumulate—achievement unlocks automatically.
Show standard achievement UI:
achievementsClient.achievementsIntent.addOnSuccessListener { intent ->
startActivityForResult(intent, RC_ACHIEVEMENT_UI)
}
Google displays a nice list with progress and icons—no need to write custom UI.
What to Consider
SDK v2 requires user to be authorized via Play Games before any calls. If not authorized—achievements don't count. Need logic: attempt automatic login on startup, graceful degradation if Play Games unavailable (absent on some devices without Google Services).
Testing: in Play Console you can reset achievements for test account via "Reset achievements". Without this, re-testing unlock is impossible.
Setting up achievement system with 5–15 achievements: 2–3 days including Play Console setup, SDK integration, and testing. Cost is calculated individually.







