안녕하세요 버섯돌이 유재성입니다.
모바일 개발과는 거리가 멀다보니 몰랐는데 최근에 구글에서 게임 서비스관련 API를 제공하는군요.^^
구글 진영이지만 Android외에도 iOS와 WEB까지 지원하는것 같네요.
메인 사이트 : https://developers.google.com/games/services/
Create great game experiences with Google Play game services. Add achievements, leaderboards, and real-time multiplayer to your mobile and web games, and let players share their gaming experience with friends.
상호 동작하는 온라인 게임 개발에 필요한 achievements, leaderboards, and real-time multiplayer등을 제공하는데
영어가 안되는 관계로 시간이되면 조금씩 맨땅에 헤딩하면서 훑어 봐야겠어요^^
안드로이드용 가이드 : https://developers.google.com/games/services/android/quickstart
Getting Started for Android
Welcome to Android game development with the Play Games services!
The Play Games services SDK provides cross-platform game services that lets you easily integrate popular gaming features such as achievements, leaderboards, Cloud Save, 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
- You should have your Android development environment set up. If you are new to developing Android applications, see Building Your First App .
- You should have a physical device running Android 2.2 (Froyo) or higher for testing.
Step 1: Download the sample app
For this training, you will need to download the Type-a-Number Challenge sample Android application.
To download the sample application:
- Download the Android samples by following the link in the Downloads page, then extract the sample files to your development machine.
- Install the Google Play services SDK .
- Import the
TypeANumber
andBaseGameUtils
code from the Android samples into your workspace. To do this in Eclipse:- Click File > Import > Android > Existing Android Code into Workspace.
- Browse to the directory where you downloaded
TypeANumber
on your development machine and click OK to import the files. - Perform the same steps for
BaseGameUtils
.
- Make sure that the Google Play services and
BaseGameUtils
library projects are referenced in your Android project. To do this in Eclipse:- Right-click your Android project and select Properties > Android.
- In the Library section, add the
google-play-services-lib
project and theBaseGameUtils
project, then click OK to save.
- In the Type-a-Number Challenge project (not
BaseGameUtils
), openAndroidManifest.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 withcom.google
,com.example
, orcom.android
. - Correct the references to the
R
resource object in the source files. To do this, addimport your.package.name.R;
to each source file that references theR
object (replaceyour.package.name
with the actual package name).
Step 2: Set up the game in the Developer Console
The Google Play Developer Console is where you manage game services for your game, and configure metadata for authorizing and authenticating your game.
To set up the sample game in the Developer Console:
- Point your web browser to the Developer Console , and sign in. If you haven't registered for the Developer Console before, you will be prompted to do so.
- Follow these instruction to add your game to the Developer Console.
- When asked if you use Google APIs in your app, select I don’t use any Google APIs in my game yet.
- For the purpose of this training, 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.
- Follow these instructions to generate an OAuth 2.0 client ID for your Android app.
- When linking your Android app, make sure to specify the exact package name you used previously when renaming sample package.
- You can use the Eclipse Export Wizard to generate a new keystore and signed certificate if you don’t have one already. To learn how to run the Export Wizard, see Compile and sign with Eclipse ADT .
- Make sure to record the following information for later:
- Your application ID: This is a string consisting only of digits (typically 12 or more), at the beginning of your client ID.
- 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.
- Configure achievements for Type-a-Number Challenge:
- Select the Achievements tab in the Developer Console.
- Add the following sample achievements:
Name Description Special Instructions Prime Get a score that's a prime number. None Humble Request a score of 0. None Don't get cocky, kid Request a score of 9999 in either mode. None OMG U R TEH UBER LEET! Receive a score of 1337. Make this a hidden achievement. Bored Play the game 10 times. Make this an an incremental achievement with 10 steps to unlock. Really Really Bored Play the game 100 times. Make this an an incremental achievement with 100 steps to unlock. - Record the IDs (long alphanumeric strings) for each achievement that you created.
- Configure achievements that are appropriate for your game. To learn more, see the concepts behind achievements and how to implement achievements in Android.
- Configure the leaderboards for Type-a-Number Challenge:
- Select the the Leaderboards tab in the Developer Console.
- Add two sample leaderboards: one named “Easy High Scores” and another named “Hard High Scores”. Both leaderboards should use Integer score formatting with 0 decimal places, and an ordering type of Larger is better.
- Record the IDs (long alphanumeric strings) for each leaderboard you created.
- Configure leaderboards that are appropriate for your game. To learn more, see the concepts behind leaderboards and how to implement leaderboards in Android.
- Add test accounts for your game. This step is needed only for apps that have not yet been published in the Developer Console. Before the app is published, only the test accounts listed in the Developer Console can log in. However, once an application is published, everyone is allowed to log in.
Step 3: Modify your code
To run the game, you need to configure the application ID as a resource in your Android project. You will also need to add games metadata in theAndroidManifest.xml
.
- Open
res/values/ids.xml
and replace the placeholder IDs. If you are creating an Android game from scratch, you will need to create this file first.- Specify your application ID in the
app_id
resource. - Specify each achievement ID that you created earlier in the corresponding
achievement_*
resource. - Specify each leaderboard ID that you created earlier in the corresponding
leaderboard_*
resource.
- Specify your application ID in the
- Open
AndroidManifest.xml
and enter your package name in thepackage
attribute of the <manifest
> element. If you are creating an Android game from scratch, make sure that you also add the following code inside the <application
> element:<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
Step 4: Test your game
To ensure that game services are functioning correctly in your game, test the application before you publish it on Google Play.
To run your game on your physical test device:
- Verify that you have set up the test account that you are using to log in to the app (as described in Step 2).
- Export an APK and sign it with the same certificate that you used to set up the project in Developer Console. To export a signed APK in Eclipse, click File >Export > Android > Export Android Application.
- Install the signed APK on your physical test device by using the
adb
tool. To learn how to install an application, see Running on a Device .
Next steps
Learn more about using game services with Android:
'Android' 카테고리의 다른 글
[펌][Android][AndEngine] perle-development의 AndEngine Tutorial (0) | 2014.11.23 |
---|---|
[Android] 안드로이드 4.3버전의 개발자 옵션 활성화 하기 (0) | 2014.11.23 |
[버섯][Android] 간단한 테스트 환경 구축(가상 안드로이드 환경 구축하기) (0) | 2014.11.23 |
[버섯][Android] 안드로이드 개발 툴 킷(ADT) 설치.. (0) | 2014.11.23 |
[버섯] GCM 관련 기초 자료 5 - 간단한 테스트 프로그램(서버측) (0) | 2014.11.23 |