Rabu, 15 Maret 2017


Get Started with Play Games Services for Android

Welcome to Android game development with the Google Play games services!
The Play Games SDK provides cross-platform Google Play games services that lets you easily integrate popular gaming features such as achievements, leaderboards, Saved Games, and real-time multiplayer (on Android) in your tablet and mobile games.
This training will guide you to install a sample game application for Android and quickly get started to create your own Android game. The Type-a-Number Challenge sample app demonstrates how you can integrate achievements and leaderboards into your game.

Before you begin

  • Set up your Android development environment. If you are new to developing Android applications, see Building Your First App.
  • Have an Android device running Android 2.3 (Gingerbread) or higher on-hand for testing.

Step 1: Download the sample app

For this developer guide, you will need to download the Type-a-Number Challenge sample Android application.
To download and set up the sample application in Android Studio:
  1. Download the Android samples from the samples download page.
  2. Import the BasicSamples project. This project includes TypeANumber and other Android game samples. To do this in Android Studio:
    1. Click File > Import Project.
    2. Browse to the directory where you downloaded android-basic-samples on your development machine. Select the file android-basic-samples/BasicSamples/build.gradle and click OK.
  3. In the TypeANumber module, open AndroidManifest.xml and change the package name fromcom.google.example.games.tanc to a different package name of your own. The new package name must not start with com.googlecom.example, or com.android.

Step 2: Set up the game in the Google Play Developer Console

The Google Play Google Play Developer Console is where you manage Google Play games services for your game, and configure metadata for authorizing and authenticating your game.
To set up the sample game in the Google Play Developer Console:
  1. Point your web browser to the Google Play Developer Console, and sign in. If you haven't registered for the Google Play Developer Console before, you will be prompted to do so.
  2. Follow these instruction to add your game to the Google Play Developer Console.
    1. When asked if you use Google APIs in your app, select I don’t use any Google APIs in my game yet.
    2. For the purpose of this developer guide, you can fill up the form with your own game details. For convenience, you can use the placeholder icons and screenshots provided in the Downloads page.
  3. Follow these instructions to generate an OAuth 2.0 client ID for your Android app.
    1. When linking your Android app, make sure to specify the exact package name you used previously when renaming sample package.
    2. You can use the Generate Signed APK Wizard in Android Studio to generate a new keystore and signed certificate if you don’t have one already. To learn how to run the Generate Signed APK Wizard, see Signing Your App in Android Studio.
  4. Make sure to record the following information for later:
    1. Your application ID: This is a string consisting only of digits (typically 12 or more), at the beginning of your client ID.
    2. Your signing certificate: Note which certificate you used when setting up your API access (the certificate whose SHA1 fingerprint you provided). You should use the same certificate to sign your app when testing or releasing your app.  









Enjoy The Guide