Developer Blog:
blockcanary-easy to find the Android app interface lag culprit
Open Source code: Moduth/blockcanary
Blockcanary fully transparent monitoring of the main thread operation, and can output effective information, help develop analysis, locate the problem, and quickly optimize the application. The features are:
- Non-intrusive, simple two lines to turn on monitoring, do not need to go everywhere, breaking code elegance.
- Precision, the output of information can help to locate the problem (accurate to the line), do not need to look like logcat, slowly.
Currently includes the core monitor output file, as well as UI display stutter information function. Only Android-enabled.
Use: (as Environment)
1. build.gradle file under App:
1 compile ' com.github.moduth:blockcanary-android:1.1.0 '2// If only want to see eject notification in the debug package3 debugcompile ' com.github.moduth:blockcanary-ui:1.1.0 '
2. Inherit and implement Blockcanarycontext class
Implement various contexts, including application identifier, user uid, network type, card slow judgment threshold, log save location, etc.
Rewrite the Getuid method, return the UID inside the app, etc...
3. Initialization
1 // in the main process initialization 2 blockcanary.install (Thisnew appblockcanarycontext ()). Start ();
Blockcanary a lightweight, non-intrusive performance monitoring component (ALI)