App Performance Management (APM) is huawei AppGallery Connect(AGC for short) is one of the quality services, which provides minut-level application performance monitoring capabilities. It supports multiple platforms including Android, iOS, and Web. You can view and analyze application performance data collected by APM, and master online application performance in real time User experience.

Performance management service advantages

Let’s take a look at the overall benefits of performance management services:

1. Cross-platform :APM supports multiple platforms including Android, iOS and Web, as well as game applications developed based on Unity and Cocos engines, making it easy to be used in various development scenarios;

2. Easy integration: zero code development, the average integration time is less than 5 minutes;

3. Scenario-based :APM currently supports application startup, page loading, page rendering and other performance monitoring scenarios, and on the basis of scenario-based, it supports application OF ANR monitoring, provides rich ANR information, and quickly solves ANR problems online;

4. Whole process: Compared with traditional performance analysis tools working in development and test state,APM runs through the whole process of application development, test and release;

APM also features real-time and visualization, with powerful data analysis and visualization systems providing minute-level real-time monitoring capabilities. To help you quickly perceive user experience problems, we have refined monitoring indicators in application startup, page loading, page rendering, network request and other scenarios. For example, network request monitoring includes request time, package size, status code, etc. In addition to these standard monitoring scenarios, to meet your customized monitoring requirements, we provide customized trace monitoring, allowing you to report customized attributes and indicators to monitor application performance in customized scenarios.

Usage scenarios of performance management services

Next, let’s take a look at the usage scenario of APM:

1. The application startup time scenario provides an application startup time analysis chart by fractional value, by time, and by application version, and supports filtering and drilling analysis by version, country, region, mobile phone model, and system version. After a new version of the application is released, we can check whether the application startup time increases or decreases.

2. In the application page rendering, which is usually referred to as the page stuck scene, you can view the proportion of slow and frozen frames on each page. For pages with a higher proportion, you can drill down and analyze according to the application version, mobile phone model, system version and other dimensions to identify the root cause of the stuck problem.

3. In the network request scenario, you can view network request response time and success rate, and drill down based on the country, region, network, and carrier information of the device to quickly locate network request exceptions.

Zero code integration AGC performance management services

With the above scenario in mind, let’s take a look at how to integrate the service on the Android platform. APM integration steps are very simple. You only need to integrate the plug-in and SDK into the code after opening the service to achieve zero code rapid integration.

1. Create an application and enable the performance management service

First, we create the application in the AGC console and open the APM. When creating the application, make sure that the package name of the application is the same as the package name in the APK. If you want to integrate APM with an existing application, the package name must be the same as the package name configured when the AGC console creates the application. After creating the project application, or using an existing application, go to “My Project – Quality – Performance Management” and click Open now.

2. Download and integrate the JSON file

In the Android Create an Android project in Studio, and the package name should be the same as the package name on the AGC interface. Then go back to the AGC home page, go to the “My Project – Project Settings – Application” interface, find and download the agconnect-services.json file to the local PC, and put it in the Android project APP Hierarchical directory.

3. Integrate APM plug-in and APM SDK

Configure the SDK address, open the Android project, and in the project level build.gradle file, configure the following:

Open the build.gradle file at the application level and add the APM SDK to your application as follows:

4. Configure the obfuscation file

We find the application-level ProGuard-rules.pro file (obfuscation profile) and add the following exclusions:

After the integration, click Sync in the upper right corner of the Android Studio project to package the application and run it on the Android device. Then you can view the data and reports collected by APM on the AGC interface. The whole integration process does not involve the writing of business code, only through a simple four steps to complete smoothly, convenient and efficient.

APM analysis reports provide detailed device and log information and performance data at the moment when performance problems occur. Real-time monitoring reports provide optimization directions for products and operations, and solve the problems that performance problems are difficult to locate and test, greatly reducing the workload of development and testing.

For more information, please visit AGC’s official website for performance management services, or check out GitHub Demo(APM), Codelab(Android), and Codelab(iOS).

There are also more AppGallery Connect services that support Android, iOS, Web and fast apps. They are cross-platform and can be integrated with Flutter, Cordova and React Native cross-platform framework, game applications developed based on Unity and Cocos game engines can also integrate AGC related services. If you have any questions, please contact us at [email protected].