FrameMonitor 是一个检测ui卡顿的sdk,也可以检测App消耗的流量,ui部分参考了leakcanary,readme文档参考了blockcanary
在build.gradle(Project)文件中
buildscript {
repositories {
jcenter()
}
}
allprojects {
repositories {
jcenter()
}
}
在build.gradle(Module)文件中
dependencies {
debugImplementation 'com.github.vip001:framemonitor-android:2.0.3'
releaseImplementation 'com.github.vip001:framemonitor-android-no-op:2.0.3'
}
在 Application类中
public class ExApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FrameMonitorManager.getInstance().init(this).start();
}
}
如果需要显示悬浮球
public class BaseActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameMonitorManager.getInstance().show(this);
}
}
见framemonitor原理分析
或见下图:
查看 CHANGELOG
如果你喜欢 FrameMonitor sdk,感觉 FrameMonitor 帮助到了你,可以点右上角 "Star" 支持一下 谢谢! ^_^ 你也还可以扫描下面的二维码~ 请作者喝一杯咖啡。
如果你希望贡献代码到FrameMonitor,你可以fork本repository然后发一个PR。
Copyright (C) 2018 vip001
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.