目录

1.Overview

HUAWEI Game Kit provides APIs to help you quickly implement the interaction between the game app and the system, by sending game data to the system and obtaining device status information from the system.

2.Application Scenarios

HUAWEI Game Kit optimizes gameplay experience, by letting your app interact with the system to apply different resource allocation strategies based on the game scene and system running status.

3.Instructions

3.1 Process Overview

3.2 Development Procedure

3.2.1 Obtaining Objects

  1. private GameManager mGameKit = GameManager.getGameManager();

3.2.2 Registering an App with a Device

Register your app with the device in either of the following ways.

If you need to listen to device information changes through callback:

  1. private GameCallBack gameSdkCallBack = new GameCallBack() {
  2.     @Override
  3.     public void onPhoneInfoUpdated(String info) {
  4.         Log.i(TAG, "onPhoneInfoUpdated: " + info);
  5.     }
  6. };
  7. boolean isSuccess = mGameKit.registerGame(packageName, gameSdkCallBack);

If you do not need to listen to device information changes through callback:

  1. boolean isSuccess = mGameKit.registerGame(packageName, null);

3.2.3 Sending Messages to the Device

  1. JSONObject jsonObject = new JSONObject();
  2. try {
  3.     jsonObject.put("MessageType", 3);
  4.     jsonObject.put("SceneID", 1);
  5.     jsonObject.put("Description", "Game Start");
  6.     jsonObject.put("ImportantLevel", 2);
  7.     jsonObject.put("Status", 1);
  8.     jsonObject.put("RecommendFps", 60);
  9.     jsonObject.put("KeyThread", "net|6001");
  10.     String message = jsonObject.toString();
  11.     mGameKit.updateGameAppInfo(message);
  12.     } catch (JSONException e) {
  13.     // Process exception
  14. }

3.2.4 Obtaining Device Information

  1. String phoneInfo = mGameKit.getPhoneInfo();

3.2.5 Listening to Device Information Changes Through Callback

To listen to device information changes through callback, please refer to section 3.2.2.

To change the callback API, call registerGame(). After the callback API is changed, the previously registered listener does not take effect.

4.App Release

Self-check the app before release.

Run the automatic check by referring to Self-check Before Release, and modify your app based on the check report.

Read the release guidelines.

Before releasing your app, read the following for the guidelines and FAQs you may need to know:

HUAWEI AppGallery Review Guidelines

App Audit FAQ

Submit a release application.

Supplement your app information in AppGallery Connect and submit an application for releasing the app. For details, see Releasing an App.

5.Game Kit SDK Data Security

5.1 SDK Working Mode

The SDK needs to be loaded to your app when you build and package the app.

It works only when requested.

5.2 SDK Permissions

When the SDK is running, the system permission is not invoked.

5.3 SDK Data Collection

The SDK uses the app ID, package name, and API call status of your app for continuous improvement of HUAWEI Game Kit.

The SDK does not collect user data.

5.4 SDK Data Protection

The Game Kit SDK does not collect personal data.

6.Game Kit 1.0.0.300 (Initially Released on 2020-03-10)

Feature description:

1. HUAWEI Game Kit allows game apps to provide elaborative scenes, configurations, and network information for the phone system, and enables the system to send feedback on status information.

2. HUAWEI Game Kit helps realize close and in-depth collaboration between the app and the phone, as well as improve gameplay experience even with restricted system resources.