English | 中文
Hmsanalyticskitdemo provides an example of integrating HUAWEI Analytics Kit with an app. It illustrates how to collect predefined events and custom events to improve user engagement and user preference. Read more about Hianalytics.
You also can use HMS Toolkit to quickly integrate the kit and run the Java demo project, as well as debug the app using a remote device for free. For details, please visit HMS Toolkit.
For more development guidance, please refer to the links below:
In this example, we demonstrate how to use the analytics SDK for Android by using the Gradle build system.
First download Hmsanalyticskitdemo by cloning this repository or downloading an archived snapshot.
In Android Studio, click Open an existing Android Studio project, and select "java" or "kotlin".
You can use the gradlew build command to build the project directly.
You should create an app in AppGallery Connect, and obtain the agconnect-services.json file and add it to the project. More to Development Process.
Use Android Studio to open the decompressed project.
Hardware requirements:
Software requirements:
After running the app you should see a screen like this:
Click TRUE or FALSE to answer the question; Click NEXT to show the next question; Click POST SCORE, log the score user got. All the information will be uploaded to the Hianalytics Console, and you can see these information in real time using Debug View.
Click button SETTINGS:
When you click SETTINGS, you will be asked for your favorite sport. Your choice will be logged by Hianalytics as a user attribute.
If you want to evaluate more about HMS Core, HMSCore on Reddit is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
huawei-mobile-services
.If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
HmsAnalyticsKitDemo is licensed under the Apache License, version 2.0.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。