Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

AndroidPerformanceMonitor

> 数据库
Open source

A transparent ui-block detection library for Android. (known as BlockCanary)

6.7K stars0 likes2 views
WebsiteGitHub

About

A transparent ui-block detection library for Android. (known as BlockCanary)

Chinese README

Android Performance Monitor

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.

  • 1.5.0 Add context that can stop monitor in debug mode.
  • 1.4.1 Bug fix.
  • 1.4.0 Bug fix, add onBlock interceptor in context.
  • 1.3.1 Enable configuration of label and icon.
  • 1.3.0 Add white-list and concern-package feature.

Getting started

You may choose how to assemble them as you like.

gradle
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)

Usage

Maximum log count is set to 500, you can rewrite it in your app int.xml.

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:

xml
<string name="block_canary_display_activity_label">Blocks</string>
java
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):

…

How does it work?

Blog in Chinese: BlockCanary.

Principle flow picture:

Screenshot

Donation

If you find this repository helpful, you may make a donation to me via alipay or wechat.

Contributors

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.

Change Log

Check CHANGELOG

Contribute

If you would like to contribute code to BlockCanary you can do so through GitHub by forking the repository and sending a pull request.

License

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.

Issues· 57 open

View all issuesOpen on GitHub
  • #153

    https://ephraimagba938.github.io/reponame/

    Updated Aug 12, 2026
  • #145

    写了一个新的卡顿监控项目, 主要是支持在设备上直接查看 卡顿的 火焰图, 感兴趣的可以看一下

    Updated Jun 11, 2026
  • #142

    logo 问题。

    Updated Jun 11, 2026
  • #149

    这个库希望有人能维护一下

    Updated Jun 10, 2026
  • #144

    Easy fix for apps targeting Android 12

    Updated Jun 5, 2026
  • #147

    android12崩溃,PendingIntent标志位需要适配

    Updated May 15, 2026
  • #146

    什么时候适配andorid12 呢?

    Updated May 12, 2026
  • #154

    [Bug] Static fileIoExecutor causes thread leak and StrictMode violations

    Updated Jan 16, 2026
  • #27

    add append mode to avoid conflicted getMainLooper().setMessageLogging()

    enhancementUpdated Sep 25, 2023
  • #148

    如何保证捕获卡顿堆栈的准确性?

    Updated Mar 24, 2023

> Tags

Javaandroidanrapmblockcanary

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 23, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库