Skip to content

Commit

Permalink
Sample Updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxihai committed May 7, 2020
1 parent 1b1cfe2 commit 90b4af9
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 33 deletions.
10 changes: 5 additions & 5 deletions Codelabs/Ads-Splash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

## Installation
Install the program on Huawei Android mobile phones.

## Supported Environments
HMS Core (APK) 4.0.0 or later has been installed on Huawei Android phones.

## Configuration
N/A


## Supported Environments
HMS Core (APK) 4.0.0 or later has been installed on Huawei Android phones.

## Sample Code
The SplashAdExample program integrates the HMS Core Ads SDK and provides the page for displaying splash ads.
The following class in the demo is used for loading and displaying ads:

SplashActivity.java
Loads and displays splash ads.
Code location:SplashAdExample\app\src\main\java\com\example\splashadexample\SplashActivity.java
Code locationSplashAdExample\app\src\main\java\com\example\splashadexample\SplashActivity.java

## License
SplashAdExample is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
13 changes: 0 additions & 13 deletions Codelabs/GameKit/.gitignore

This file was deleted.

94 changes: 94 additions & 0 deletions Codelabs/GameKit/gamekitdemo/gamekitdemo.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":gamekitdemo" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":gamekitdemo" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.0.1" />
<option name="LAST_KNOWN_AGP_VERSION" value="3.0.1" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/rs/debug;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="Android API 29 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: com.huawei.game:gamekit:1.0.0.300@jar" level="project" />
</component>
</module>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2019. All rights reserved.
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
*/

package com.huawei.game.gamekitdemo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:text="注册(有Callback接口)" />
android:text="Register" />

<Button
android:id="@+id/register_sdk_without_callback"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:text="注册(无Callback接口)" />
android:text="Register(no callback)" />

<Button
android:id="@+id/get_phone_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:text="获取系统信息" />
android:text="Get phone info" />

<Button
android:id="@+id/send_data"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:text="发送游戏信息" />
android:text="Send data" />

</LinearLayout>
10 changes: 0 additions & 10 deletions Codelabs/GameKit/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
## Table of Contents

* [Introduction](#introduction)
* [Getting Started](#Getting-Started)
* [Installation](#installation)
* [Supported Environments](#supported-environments)
* [Sample Code](#Sample-Code)
Expand All @@ -15,15 +14,6 @@
Game Kit provides refined scene information, configuration information, network information, etc. to the system through the Game App, and the system feeds back system status information to the Game App,
so Game and system could use this information for closer and deeper collaboration, in the case of limited system resources To further improve the player's gaming experience.

## Getting Started

1. Register as a developer.
Register a [HUAWEI account](https://developer.huawei.com/consumer/en/).
2. Create an app.
Create an app and enable APIs.
3. Build the demo.
To build this demo, please first import the demo to Android Studio (3.X or later). Then download the agconnect-services.json file of the app from AppGallery Connect, and add the file to the app directory (\app) of the demo. For details, please refer to [Preparations for Integrating HUAWEI HMS Core](https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html)

## Installation
Use DevEco Studio or Android Studio to open the decompressed project.

Expand Down

0 comments on commit 90b4af9

Please sign in to comment.