2. Add the APM plug-in to the baseProjectTemplate.gradle file.
```
3. [Adding Indicators to Monitor Specific Network Requests](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-apms-addnetworkmeasure)
5. [Configuring the AndroidManifest.xml File](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-apms-configuremanifest)
### Optional: Using APM Game SDK
In the initialization method at the beginning of the game, call the startGamePlugin() method of APMS to enable the SDK
void Start()
{
// In order to start APMS Game Plugin, you need to call this method
GameAPM.getInstance().start();
// Your own business code
// ...
}
void OnDestroy() {
// In order to start APMS Game Plugin, you need to call this method
GameAPM.getInstance().stop();
// Your own business code
// ...
}
In order to quickly find out whether the scene loading time exceeds the normal range, you can call APMS startLoadingScene (GameAttribue gameAttribute) and stopLoadingScene (String scene) to record the scene loading time.
public void scenceLoadToGame()
{
// start record the loading scene time
String scene = GameAPM.getInstance().startLoadingScene(new GameAttribute("Game", LoadingState.NOT_LOADING));
SceneManager.LoadScene("Game");
// Other code
// ...
// stop record the loading scene time
GameAPM.getInstance().stopLoadingScene(scene);
}
You can view detailed game performance data on the "Application Performance Management" page, including scene analysis data, frame time data, and scene loading data.
Prerequisites:
1. Your application has enabled the APM service.
2. Your application has integrated the APM Game SDK and runs on the device.
View game scene analysis:
1. Log in to the AppGallery Connect website and click on ‘My Projects’.
2. Find your project in the project list, and select the application you want to view in the application list under the project.
3. Choose ‘Quality -> Performance’ Management to enter the ‘Application Performance Management’ page.
4. Click ‘Experience Analysis -> Game Scene Analysis’ to enter the game scene analysis page.