Your speaker: +StefanHoth / @stefanhoth
C++
on Android
dependencies {
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.google.android.gms:play-services-games:7.5.0'
//optional for "Nearby Players" matchmaking
compile 'com.google.android.gms:play-services-nearby:7.5.0'
}
Add to build.gradle
https://play.google.com/apps/publish/
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest>
<application>
// Activities, Services etc go here
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
</application>
</manifest>
gamesApiClient = new GoogleApiClient.Builder(activity)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
Games.Achievements.unlock(getApiClient(), "my_achievement_id");
Games.Achievements.increment(getApiClient(),
"my_incremental_achievment_id", 1);
startActivityForResult(
Games.Achievements.getAchievementsIntent(gamesApiClient),
CODE_REQUEST_ACHIEVEMENTS);
Games.Leaderboards.submitScore(
mGoogleApiClient,
"leaderboard_fastest_id",
1337);
startActivityForResult(
Games.Leaderboards.getLeaderboardIntent(
mGoogleApiClient,
"leaderboard_fastest_id"
),
REQUEST_LEADERBOARD);
{
"bonusGems": 2134,
"extraSeconds": 12
}
Games.Events.increment(mGoogleApiClient, "event_games_won_id", 1);
startActivityForResult(
Games.Quests.getQuestsIntent(
mGoogleApiClient,
Quests.SELECT_ALL_QUESTS
),
REQUEST_QUESTS);
Create & Update
achievements + leaderboards
https://youtu.be/AK342F1Hk84
https://developers.google.com/games/services/
https://github.com/stefanhoth/ropasclisp
Stefan Hoth
stefan@novoda.com
@stefanhoth
+StefanHoth
stefanhoth