A transparent ui-block detection library for Android. (known as BlockCanary)
A transparent ui-block detection library for Android. (known as BlockCanary)
A transparent ui-block detection library for Android, app only needs one-line-code to setup.
The naming is to pay respect to the great library LeakCanary, ui-related codes are modified from leakcanary's ui part.
You may choose how to assemble them as you like.
dependencies {
// most often used way, enable notification to notify block event
compile 'com.github.markzhai:blockcanary-android:1.5.0'
// this way you only enable BlockCanary in debug package
// debugCompile 'com.github.markzhai:blockcanary-android:1.5.0'
// releaseCompile 'com.github.markzhai:blockcanary-no-op:1.5.0'
}As this library uses getMainLooper().setMessageLogging(), please check if you set it in your app (related issue https://github.com/moduth/blockcanary/issues/27)
Maximum log count is set to 500, you can rewrite it in your app int.xml.
<integer name="block_canary_max_stored_count">1000</integer>Monitor app's label and icon can be configured by placing a block_canary_icon drawable in your xhdpi drawable directory and in strings.xml:
<string name="block_canary_display_activity_label">Blocks</string>public class DemoApplication extends Application {
@Override
public void onCreate() {
// ...
// Do it on main process
BlockCanary.install(this, new AppBlockCanaryContext()).start();
}
}Implement your application BlockCanaryContext context (strongly recommend you to check all these configs):
…Blog in Chinese: BlockCanary.
Principle flow picture:
If you find this repository helpful, you may make a donation to me via alipay or wechat.
This library is initially created by markzhai, and maintained under the organization moduth with nimengbo and zzz40500.
Special thanks to android-cjj, Mr.Bao, chiahaolu to contribute.
Check CHANGELOG
If you would like to contribute code to BlockCanary you can do so through GitHub by forking the repository and sending a pull request.
Copyright (C) 2016 MarkZhai (http://zhaiyifan.cn).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.https://ephraimagba938.github.io/reponame/
写了一个新的卡顿监控项目, 主要是支持在设备上直接查看 卡顿的 火焰图, 感兴趣的可以看一下
logo 问题。
这个库希望有人能维护一下
Easy fix for apps targeting Android 12
android12崩溃,PendingIntent标志位需要适配
什么时候适配andorid12 呢?
[Bug] Static fileIoExecutor causes thread leak and StrictMode violations
add append mode to avoid conflicted getMainLooper().setMessageLogging()
如何保证捕获卡顿堆栈的准确性?