Integration of Huawei Analytics Kit in HarmonyOS

Shiddalingeshwar M S
Huawei Developers
Published in
3 min readJan 14, 2022

Introduction

In this article, we will learn how to integrate Huawei Analytics Kit. It is a one-stop solution to get user behavior analysis in different platforms for all yours products such as mobile apps, web apps and quick apps. It helps developers to get detailed analysis report and also provides crash reports by default. It offers scenario-specific data collection, management, analysis, and usage, helping enterprises to achieve effective user acquisition, product optimization, precise operations, and business growth.

Supported Countries/Regions

Please refer to Supported Countries/Regions.

Development Overview

You need to install DevEco Studio IDE and I assume that you have prior knowledge about the HarmonyOs and java.

Hardware Requirements

  • A computer (desktop or laptop) running Windows 10.
  • A HarmonyOS phone (with the USB cable), which is used for debugging.

Software Requirements

  • Java JDK installation package.
  • DevEco Studio installed.

Steps:

Step 1: Create a HarmonyOs Application.

Step 2: Create a project in AppGallery.

Step 3: Configure App in AppGallery

Step 4: Follow SDK integration steps

Let’s start coding

Result

Login screen events like login attempt and login events are captured and product list screen item click events are captured in AppGallery, its up to you which all events you would like to trigger on which events.
You can check the real-time overview of new users, active users, events in last 30 min in the AppGallery
You can check new users, Day-2 retention rate, accumulated users average user duration and last 60 min and events in AppGallery.
You can check last 30 min events reported in AppGallery.
You can see the event parameter details in AppGallery
Here you can manage all your events and also create new custom event
Here you can upload bulk events, you can download the template and add events details and upload the same file.
Here you can check the hot events and user attributes of app

Tips and Tricks

  • Add required dependencies without fail.
  • Add required images in resources > base > media.
  • Add custom strings in resources > base > element > string.json
  • Define supporting devices in config.json file.
  • Define actions in config.json.
  • Do not log the sensitive data.
  • Use respective Log methods to print logs.

Conclusion

In this article, we have learnt Huawei Analytics Kit in HarmonyOs. Sample application shows how login and products events can be captured in AppGallery and based on the data collected, you can make wise decision to tackle the market and product movements.

Thank you so much for reading this article and I hope this article helps you to understand Huawei Analytics Kit in HarmonyOs. Please provide your comments in the comment section and like.

References

Analytics Kit

Checkout in forum

--

--