andengine에서 Google Play 서비스 리더 보드를 구현하는 방법을 알려주십시오.andengine에서 Google Play 리더 보드를 구현하는 방법은 무엇입니까?
튜토리얼이 있습니까?
나는 내 질문과 관련하여 google에서 모든 질문을 검색하지만 유용하지 않습니다.
andengine에서 Google Play 서비스 리더 보드를 구현하는 방법을 알려주십시오.andengine에서 Google Play 리더 보드를 구현하는 방법은 무엇입니까?
튜토리얼이 있습니까?
나는 내 질문과 관련하여 google에서 모든 질문을 검색하지만 유용하지 않습니다.
여기서해야 할 일이 몇 가지 있습니다.
1) BaseGameUtils를 프로젝트로 가져옵니다. 당신은
dependencies { .... compile project(':BaseGameUtils’) ....
3) 확인 당신이
4 올바르게
<manifest xmlns:android="http://schemas.android.com/apk/res/android”
………
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application …….
<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" />
……
매니페스트를 업데이트했습니다 포함
here
2) 업데이트하여 build.gradle 파일 종속성에서 다운로드 할 수 있습니다) BaseGameUtils에서 BaseGameActivity의 이름을 예 : GMSBaseGameActivity를 사용하여 SimpleBaseGameActivity 또는 BaseGameActivity (사용중인 경우)를 확장합니다. 그런 다음 주 활동을 업데이트하여 GMSBaseGameActivity를 확장하십시오 (onSignInFailed 및 onSignInSucceeded 무시).
이제 앱을 시작할 때 앱이 자동으로 연결됩니다. 사용자가 로그인되어있는 경우
사용 getGameHelper().isSignedIn()
는 쿼리합니다.
사용 startActivityForResult(Games.Leaderboards.getLeaderboardIntent(getGameHelper().getApiClient(), getResources().getString(R.string.your_leaderboard_id)), 0);
은 점수를 제출하는 리더
사용 Games.Leaderboards.submitScore(getGameHelper().getApiClient(), getResources().getString(R.string.your_leaderboard_id), this_is_the_score_submitted);
을 표시합니다.