tencent cloud

All product documents
Tencent Cloud Observability Platform
Crash and ANR Monitoring
Last updated: 2024-05-14 12:36:06
Crash and ANR Monitoring
Last updated: 2024-05-14 12:36:06

Enabling Feature

Initialization requires enabling Crash and ANR monitoring, which by default monitors Crash and ANR information.
// ModeStable mode by default includes Crash and ANR monitoring.
QAPM.beginScene(QAPM.SCENE_ALL, QAPM.ModeStable);
QAPM provides APIs for uploading custom log files in case of crashes or ANRs, if necessary. An example is as follows:
QAPM.setProperty(QAPM.PropertyExtraDataListener, new IExtraDataListener() {
// This callback is executed when an ANR occurs.
@Override
public List<String> onAnrExtraFileHandler() {
List<String> files = new ArrayList<>();
File[] fileArray = new File("xxxx").listFiles();//Enter the folder name at xxx.
for (File file : fileArray) {
files.add(file.getAbsolutePath());
}
return files;
}
// This callback is executed when a crash occurs.
@Override
public List<String> onCrashExtraFileHandler() {
List<String> files = new ArrayList<>();
File[] fileArray = new File("xxxx").listFiles();//Enter the folder name at xxx.
for (File file : fileArray) {
files.add(file.getAbsolutePath());
}
return files;
}
});

Verifying Whether the Feature Is Working Properly

Retrieval tag: QAPM_manager_QAPMPluginManager



Retrieval tag: QAPM_crash
The following log message in case of crashes or ANRs indicates that QAPM has collected this exception:



Retrieval tag: plugin::144
The following log message indicates that QAPM has successfully reported this exception. An example is as follows:



The other crash retrieval tags are as follows:
ANR: [plugin::140].
NativeCrash: [plugin::146].
Note:
To avoid lagging, keep the logic in the interface callbacks as simple and straightforward as possible.
Uploaded files must be less than 20 MB in size. Files larger than the limit will not be uploaded. Select helpful log files.
Crash events can be viewed on the Mobile Monitoring Crash page, and ANR rates can be viewed in the Overview page.


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon