1

Article Directory

• I. Introduction
• Two, fast integration
o 2.1 Account registration
o 2.2 Create an application
o 2.3 Demo download
o 2.4 Demo import
o 2.5 Demo trial run
• Three, the ultimate experience
o 3.1 The first App crashes
o 3.2 View background crash information (1 minute delay +)
o 3.3 Error handling
o 3.4 Alarm Settings
o 3.5 Enterprise WeChat Robot
o 3.6 Alarm trigger
• Four, a little suggestion
o 4.1 Lack of App version in error details
o 4.2 The logic flow of error handling

I. Introduction

I have always used Tencent’s bugly before
Currently invited to recommend Umeng+U-APM, let’s try it out

Two, fast integration

2.1 Account registration
Umeng+Registration
Registration is fast, there are no cumbersome steps and redundant information to fill in, like

2.2 Create an application
Application performance monitoring platform U-APM


2.3 Demo download
For a quick experience, we skip the SDK integration step and use the official Demo directly.
SDK integration is also very convenient, just look at the official document: Android SDK integration process

Demo download: MultiFunctionAndroidDemo: Youmeng Multifunctional Android Demo

2.4 Demo import
Import Project File->New->Import Porject
During the period, I encountered a problem. If you also encounter this problem, you can refer to the blog post: Android Studio Failed to open zip file solution

2.5 Demo trial run
After modifying preInit(Context context,String appkey,String channel), you can run Demo
// SDK pre-initialization function
// The preInit pre-initialization function takes very little time and will not affect the user experience of the first cold start of the App
public static void preInit(Context context,String appkey,String channel)
preInit() is called in App.java, and you can pass in your own appkey.
The appkey is copied in the figure below.



After the demo runs, go to the background to check again, you will find that the status of the application becomes: integrated

Three, the ultimate experience

3.1 The first app crashes

• It's a bit unexpected, the first crash message came out a bit quickly.
• Home -> Click Statistics UApp -> Click Program Crash

3.2 View background crash information (1 minute delay +)

• At this time, you must quickly check the background to see if there is any error message reported
• Keep refreshing the background, while comparing the real-time time, there is a delay of about 1 minute and 10 seconds before the error message is displayed in the background. Compared with Tencent bugly, it’s a little bit better.
• However, the error message is given in detail, directly find line 94 of com.umeng.soexample.analytics.UappActivity
• Take a closer look, the obvious error is that the string length of "123" is only 3 and cannot be indexed to 10.


3.3 Error handling

• Change not repaired to repaired
• First of all, deliberately not repairing the code, causing another program crash
o The processing status remains unchanged or has been repaired
• Secondly, modify the App version versionCode to 2, versionName to 1.0.1, and other things unchanged, causing another program crash
o The processing status remains unchanged, or it has been repaired.
o However, the version range has changed from 1.0 to 1.0.1. This is a bit mixed, and I have some opinions on this. For details, see Chapter 4 below.


3.4 Alarm settings

• Enter through the alarm entry of the error list
• New alarm plan
o Alarm name
o Trigger conditions: >3 times
o Effective application version: all
o Reaching method: Email, corporate WeChat


3.5 Enterprise WeChat Robot

• Add a group chat
• Add group robots
• Get the webhook of the robot

3.6 Alarm trigger

• After the alarm is set successfully, the alarm will be triggered
• No response after ordering it several times, weird
• It’s okay, be patient, wait~
• I finally waited for it~


• It is obvious that the alarm is triggered once every hour
• Basically are pushed around 07 minutes every hour

Four, a little suggestion

4.1 Lack of App version in the error list

• App version number is reflected in the error list, which is good
• But it is not reflected in the error details. On the contrary, there is an additional SDK version number, which is easy to confuse

4.2 The logic flow of error handling

The logic flow of error handling can be optimized as follows:
• In Crash Analysis -> Error List -> Processing Status, when ticking repaired, choose to repair in the XX.XX.XX version
• If the subsequent version is greater than the XX.XX.XX version, and the same error is reported, the processing status will be automatically modified to repair failure
• Add a processing flow record to record in detail that this bug was fixed by XX person in XX version at XX time, and then recurred in XX version...
After modifying according to this logic, the processing state is dynamic and more information is added.
Compared with the current state, once the processing state is manually modified, its state has not changed, is it much stronger~

Author: Kang Weijian
1. Many years of experience in embedded software development;
2. Also good at Android development and WeChat applet development;
3. Worked as a system engineer in a large factory, as an embedded supervisor in a small factory, and now a software manager in a startup company;
4. I have my own insights on the development of the Internet of Things. I like to precipitate, organize and share my own technical knowledge in my spare time.


性能优化实践者
11 声望220 粉丝