目录

1.Registration and Sign-in

Before integrating your app with HUAWEI Game Kit, register as a HUAWEI developer and complete identity verification on the HUAWEI Developer website. For details, please refer to Registering as a Developer.

2.App Creation

2.1 Creating an App

Create an app in AppGallery Connect (AGC). For details, please refer to Creating an App.

2.2 Generating and Configuring a Signing Certificate Fingerprint

Check whether a signing certificate fingerprint has been configured in AGC. If no signing certificate fingerprint exists, generate one and configure it. For details, please refer to Generating a Signing Certificate Fingerprint and Configuring the Signing Certificate Fingerprint.

3.Permission Application

To ensure app security, to use open APIs of Game Kit, you need to apply for permissions from Huawei. You can do this by simply sending an application to devConnect@huawei.com.

Note:

Provide the ID generated by HUAWEI Developer for your app in the application.

Ensure that a signing certificate fingerprint has been configured for your app.

4.Environment Requirements

1. Android Studio: V3.0.1 or later is recommended.

2. Mobile phone: The system software version must be EMUI 10.1 or later.

5.Environment Building

5.1 Android Studio Access Process

5.1.1 Creating a Project

Create or open an existing Android Studio project.

5.1.2 Adding App ID Information

Add the app ID generated when creating an app on HUAWEI Developer to the AndroidManifest.xml file.

Note: Do not change the value of android:name.

  1. <meta-data
  2. android:name="com.huawei.hms.client.appid"
  3. android:value="appid=xxxxxxxxx"/>

5.1.3 Adding Dependencies

1. Configure the repository in the build.gradle file of the project.

  1. buildscript {
  2.     repositories {
  3.     jcenter()
  4.     google()
  5.     maven { url 'https://developer.huawei.com/repo/' }
  6.     }
  7. ...
  8. }
  9. allprojects {
  10.     repositories {
  11.         jcenter()
  12.         google()
  13.         maven { url 'https://developer.huawei.com/repo/' }
  14.     }
  15. }

2. Add the following dependencies to the build.gradle file in the app directory of the project.

  1. repositories {
  2.     flatDir {
  3.     dirs 'libs'
  4.     }
  5. }
  6. dependencies {
  7.     implementation 'com.huawei.game:gamekit:1.0.0.300'
  8. }