1.2. Android SDK Installation
1.2. Android SDK Installation
- 1 1.2. Android SDK Installation
- 1.1 1.2.1. Installation Environment
- 1.2 1.2.2. SDK Configuration
- 1.3 1.2.3. IDP Authentication Detail Configuration
- 1.4 1.2.4. AndroidManifest.xml File Configuration
- 1.4.1 1.2.4.1. Common Settings
- 1.4.2 1.2.4.2. URL Promotion Configuration
- 1.4.3 1.2.4.3. Initial Event Configuration
- 1.4.4 1.2.4.4. Kakao Authentication Configuration
- 1.4.5 1.2.4.5. Google Authentication Configuration
- 1.4.6 1.2.4.6. Facebook Authentication Configuration
- 1.4.7 1.2.4.7. Kakao Gameshop Settings
- 1.4.8 1.2.4.8. Declaring queries elements for package visibility
- 1.4.9 1.2.4.9. Permission Settings
- 1.4.10 1.2.4.10. Setting Enable Http
- 1.4.11 1.2.4.11. Manage supported language resources
- 1.5 1.2.5. Confirming and registering key hash
- 1.6 1.2.6. Build confirmation
1.2.1. Installation Environment
IDE: Android Studio
If you are developing on an existing Eclipse base, you should proceed with migration as shown below.
Right-click on the game project you are developing and select 'Remove> and' Apply 'all the SDK libraries added from' Properties> Android> Library '.Please refer to the Migration Guide provided by Google to migrate only game projects to Android Studio.
Follow this guide to apply the SDK later.
JDK: JDK 8 or later
Android SDK: Android 12 (API 31)
OS: Android 5.0, API 21+ support
Gradle Version: 6.1.1
1.2.2. SDK Configuration
1.2.2.1. build.gradle(project level)
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
// Required 3.1.2 or later
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://devrepo.kakao.com/nexus/content/groups/public/'
name 'kakao'
}
maven {
url 'https://s3.ap-northeast-2.amazonaws.com/kakao-sdk-release/release/'
name 'Kakaogames'
}
}
}
1.2.2.2. gradle.properties
Migrated to AndroidX from version 3.10.4. Follow the guide and set the following in your gradle.properties file:
# Project-wide Gradle settings.
org.gradle.jvmargs=-Xmx4608M
KAKAO_GAME_SDK_VERSION=3.10.4
# Added following settings.
android.useAndroidX=true
android.enableJetifier=true
1.2.2.3. build.gradle(app level)
Optionally set the necessary modules in the build.gradle file of the application as shown below.
Developers who can not use 'implementation' using gradle version earlier than 3.0 can use 'compile'.
(Note) From 3.10.11, it has been changed from com.kakaogame to com.kakaogame.publishing. When upgrading from 3.10.11 or lower to 3.10.11 or higher, please modify it.
android { ... // Required to use the feature of Java 8 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } ... dependencies { // Required for games that use device authentication. implementation "com.kakaogame:idp_device:$KAKAO_GAME_SDK_VERSION" // Required for games that use Facebook authentication. implementation "com.kakaogame:idp_facebook:$KAKAO_GAME_SDK_VERSION" // Required for games that use Google game authentication. implementation "com.kakaogame:idp_googlegame:$KAKAO_GAME_SDK_VERSION" // Required for games that use Kakao authentication. implementation "com.kakaogame:idp_kakao:$KAKAO_GAME_SDK_VERSION" // Required for games that use Apple authentication. implementation "com.kakaogame:idp_siwa:$KAKAO_GAME_SDK_VERSION" // Required to use the features of the Kakao game SDK. implementation "com.kakaogame.publishing:gamesdk:$KAKAO_GAME_SDK_VERSION" } apply plugin: 'com.google.gms.google-services' // Google Services plugin
1.2.2.4. External library dependencies
Each required library has a dependency in the following versions. Included automatically when linking the Kakao Game SDK.
SDK version | Module | External Libraries |
---|---|---|
3.7.1
| gamesdk |
|
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
| |
3.8.0 | gamesdk |
|
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
| |
3.9.1
| gamesdk |
|
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
| |
3.10.0 | gamesdk |
|
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
| |
3.10.4(AndroidX) | gamesdk |
|
idp_facebook |
| |
idp_googlegame |
| |
3.10.6 | gamesdk |
|
idp_facebook |
| |
idp_googlegame |
| |
3.11.0 | idp_facebook |
|
3.11.5 | common |
|
gamesdk |
| |
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
| |
3.13.4 | common |
|
gamesdk |
| |
idp_kakao |
| |
idp_facebook |
| |
idp_googlegame |
|
If your game uses an external library that overlaps dependencies with the above libraries, you can remove the link and use it with the higher version as shown below.
build.gradle(app level)
Below is an example of changing the Facebook SDK version.
build.gradle(app level)
1.2.2.5. kakao_game_sdk_configuration.xml
Create 'kakao_game_sdk_configuration.xml' in the 'src / main / assets' directory of the application and open the file with the editor to add the information.
Key | Required | Description | Example |
---|---|---|---|
appId | O | Issued App ID You can check it in 3.0 Admin -> Game Build -> Client Version Control. | 103815 |
appSecret | O | This is the same as the Native App Key, which can be found in Kakao Partner Center> Game Management> Select App> Game Details. | 951b75bf17fe0885ab5106ba2a9f9bc9 |
appVersion | O | App version (The Unity, PlayerSettings, and Version values are used as they are.) | 1.0.0 |
market | O | Setup a market for Android deployments.( "googlePlay", "oneStore", "kakaogameShop") | googlePlay |
debugLevel | X | Log level of the Kakao Game SDK. ("Verbose", "Debug", "Error", "None") | None |
serverType | X | Server type. ("real" / "real_global" : Use if needed to access global server) | real |
assets/kakao_game_sdk_configuration.xml
1.2.3. IDP Authentication Detail Configuration
1.2.3.1. Kakao Authentication Detail Configuration
Add the following resource file to ‘res/values/kakao_sdk_idp_kakao.xml’ and set values:
The value of “KAKAO_APP_KEY” needs to be changed to the value issued.
res/values/kakao_sdk_idp_kakao.xml
1.2.3.2. Facebook Authentication Detail Configuration
Add the following resource file to ‘res/values/kakao_sdk_idp_facebook.xml’ and set values:
The value of “FACEBOOK_APP_ID” needs to be changed to the value issued.
The value of “FACEBOOK_CLIENT_TOKEN” can be found at 2.1 Facebook | 2.1.2. Facebook Developer Center (Client Token Settings) SDK 3.15.0 or later ...
res/values/kakao_sdk_idp_facebook.xml
1.2.3.3. Google Authentication Detail Configuration
Add the following resource file and value in res / values / kakao_sdk_idp_google.xml.
The value of "Google App ID" and "Google Web Client ID" need to be changed to the value issued.
res/values/kakao_sdk_idp_google.xml
1.2.3.4. SigninWithApple Authentication Detail Configuration (3.10.6 and later)
Add the following resource file and value in res / values / kakao_sdk_idp_siwa.xml.
The value of "SIWA Client ID" needs to be changed to the value issued.
res/values/kakao_sdk_idp_siwa.xml
1.2.4. AndroidManifest.xml File Configuration
The following items must be configured in the game app's ‘AndroidManifest.xml’:
1.2.4.1. Common Settings
Set the lowest version of SDK supported to 21.
android:minSdkVersion="21"
Set the SDK target version to 31.
Starting November 1, 2018, you will not be able to update apps unless targetSdk version is at least 26.
Modify to support behavior changes that affect all apps running on Android 12 in 3.13.3.
Declare the android:exported attribute.
The SDK uses the following common permissions:
android.permission.INTERNET
android.permission.ACCESS_NETWORK_STATE
Add settings for Multi-window
In order to respond to split-screen and foldable phones of Android phones, add the following to the application tag.
android:resizeableActivity="true"
Add the following to Activity tag.
android:configChanges="orientation|screenSize|keyboard|screenLayout|screenSize|smallestScreenSize"
The following activities must be configured for IDP authentication:
com.kakaogame.KGAuthActivity
Add Google configuration to get ADID (affected version: 3.10.4 or later)
If there is no setting in the latest version of Google Ads, there is an issue where the app does not work.
If your game uses AdMob, insert the game's AdMob App Id in the appropriate field.
Need to declare the permission
Advertising ID - Play Console Help
you need to declare
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
permission.
AndroidManifest.xml (Common setting)
1.2.4.2. URL Promotion Configuration
For URL promotion support, an intent filter must be set in the main Activity of the game as shown below.
The scheme is composed of ‘"kakaogame" + App ID’. (For example, if the app ID is 123456, the scheme value is “kakaogame123456”.)
AndroidManifest.xml (URL Promotion setting)
1.2.4.3. Initial Event Configuration
When using version 3.10.6 or later, the INSTALL_REFERRER setting below is not done by the manifest.
Developers upgrading to version 3.10.6 using a lower version should delete the following setting.
Set the initial declaration of the Install Referrer Receiver.
1.2.4.3.1. Multiple broadcast receivers
Using multiple broadcast receivers provides the ability to automatically forward INSTALL_REFERRER events to all other receivers.
It is also available if you are not using another ad platform.
Multiple broadcast receivers must be declared first among the broadcast receivers for which the INSTALL_REFERRER action is defined.
AndroidManifest.xml (Set invitation events)
1.2.4.3.2. Single broadcast receiver
If you use multiple broadcast receivers from different ad platforms provide, use a single broadcast receiver.
For instructions on how to use the broadcast receiver of your ad platform, refer to the appropriate ad platform guide.
AndroidManifest.xml (Set invitation events)
1.2.4.4. Kakao Authentication Configuration
Starting with version 3.11.0, the following have been removed.
A KakaoWebViewActivity declaration is needed.
A com.kakao.sdk.AppKey meta-data declaration must be added.
The following intent filter declaration must be added to the main Activity:
The following intent filter declaration must be added to the AuthCodeHandlerActivity:
The following intent filter declaration must be added to the AgeAuthActivity:
Declare the android:exported attribute explicitly.
AndroidManifest.xml (Kakao Authentication Settings)
1.2.4.5. Google Authentication Configuration
A SignInHubActivity declaration must be added.
A com.google.android.gms.version/com.google.android.gms.games.APP_ID meta-data
If you hardcode a number in APP_ID, authentication will fail. It must be written in the form of “@string/google_app_id”.
AndroidManifest.xml (Google Authentication Settings)
1.2.4.6. Facebook Authentication Configuration
A FacebookActivity declaration must be added.
A com.facebook.sdk.ApplicationId meta-data declaration must be added.
A com.facebook.sdk.ClientToken meta-data declaration must be added.
AndroidManifest.xml (Facebook Authentication Settings)
1.2.4.7. Kakao Gameshop Settings
When using version 3.11.0 or later, you should delete the following setting.
The KakaoPaymentActivity/KakaoPaymentListActivity/ResultOfBankaActivity declaration should be added.
The scheme used for the intent filter is a fixed value and does not need to be changed.
AndroidManifest.xml (Kakao Gameshop setting)
1.2.4.8. Declaring queries elements for package visibility
https://developer.android.com/training/package-visibility/declaring
If it is less than a specific version, you must add a query to use App2App login or third-party app features.
AndroidManifest.xml
1.2.4.9. Permission Settings
To use KGApplication.RequestPermissionsWithDescriptionPopup API, meta-data declaration in AndroidManifest.xml is required.
If you do not set meta-data, the OS pops up a permission popup and you will not be able to use the API.
AndroidManifest.xml (Permission Popup Setting)
1.2.4.10. Setting Enable Http
If targetSdkVersion is set to 28 version or higher, and the game using http requires the following settings.
Do not use http inside the Kakao Game SDK. This is only required if the developer needs an http call such as cdn.
Require to use Kakao SDK v3.8.3 or later version
Domain settings that require http call
Create "res / xml / network_security_config.xml" file to add domain list that requires http connection
network_security_config.xml
Set the above generated file to networkSecurityConfig in your application in AndroidManifest.xml.
AndroidManifest.xml
1.2.4.11. Manage supported language resources
You can remove the folder below if you want to remove the additional language your game dosen't support.
For example, if you want to remove the Japanese language setting, remove the KakaoGameSDK> res> values-ja folder.
1.2.5. Confirming and registering key hash
The build machine's key hash must be registered for the built app. The key has can be confirmed with the following method.
Find the debug key hash and release key has will the guidelines provided below and register at [GameCenter > Admin > Register Key Hash].
1.2.5.1. Finding the debug key hash
Once the Android SDK is installed, the development certificate is saved in the 'debug.keystore' file as an alias for 'androiddebugkey'. Use the method provided below to check the certificate. (Note: The following cannot be used to find the actual key hash.)
keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} -storepass android -keypass android |
---|
The key has that will be registered in the keystore must be found using the following method
The following sample must be executed in the built machine.
Please use openssl version 1.0.2 or higher
keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} -storepass android -keypass android | openssl sha1 -binary | openssl base64 |
---|
This method is guaranteed to work properly under Linux, but it may not get the correct value in the Windows environment.
If you get a key hash error, try the following:
keytool -exportcert -alias androiddebugkey -keystore {debug_keystore_path} > ./debug.txt |
---|
[debug_keystore_path]
OS X and Linux : Can be checked at Eclipse "ADT > Preferences > Android > Build > Default debug keystore".
(Ex : ~/.android/debug.keystore)
Windows : Can be checked at Eclipse "Window > Preferences > Android > Build > Default debug keystore".
Windows Vista와 Windows 7 (Ex: C:\Users\.android\debug.keystore)
Windows XP (Ex : C:\Documents and Settings\.android\debug.keystore)
keytool : Exists under $JAVA_HOME/bin.
openssl : Download and install for Windows.
1.2.5.2. Finding the release key hash
keytool -exportcert -alias [release_key_alias] -keystore [release_keystore_path] | openssl sha1 -binary | openssl base64 |
---|
Check for invalid android_key_hash error
If you receive a <com.kakao.util.exception.KakaoException: AUTHORIZATION_FAILED: invalid android_key_hash or ios_bundle_id or web_site_url> error after you have obtained a key hash and registered it in the Game Center, you can check whether you are using the correct key hash as shown below.
Temporarily change the onCreate () in the MainActivity class used by the game to:MainActivity
Run the above code to check the key hash in the message shown in the Logcat output.
1.2.6. Build confirmation
Make sure the project builds normally.