-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何把结果写成文件 #10
Comments
/**
* Path to save log, like "/blockcanary/", will save to sdcard if can. if we can't save log to sdcard (eg: no permission),
* else we will try to save to "${context.getExternalFilesDir("BlockCanaryEx")}${provideLogPath()}", if we failed too,
* we will save to "${context.getFilesDir()${provideLogPath()}"}"
*
* Note: running in none ui thread
*
* @return path of log files
*/
public String provideLogPath() {
return "/blockcanaryex/" + getContext().getPackageName() + "/";
} BlockCanary会自动把日志写到存储里面。 |
/**
* Block listener, developer may provide their own actions
*
* @param blockInfo {@link BlockInfo}
*/
@Override
public void onBlock(BlockInfo blockInfo) {
} 如果没有ui界面,你可以复写Config的onBlock方法监听卡顿事件,把blockInfo打印到logcat也可以。 |
谢谢谢谢,其实问完问题后就找到了那个文件,之前没有仔细看代码。。。。。。 还有一个问题,代码里边有好多 mRandom.nextInt(Integer.MAX_VALUE); 产生随机数,这个我没看懂,不知道用来干嘛的。。。本人android菜鸟一枚 原谅哈 |
单纯模拟计算耗时操作。 |
感谢up主分享这些好的东西,还有一个小小的问题: |
运行了你的demo,发现每个方法耗时结果点击后会有更详细的信息,这个在/sdcard/blockcanaryex//下的文件里似乎没有,请问如果我想得到这些更详细的信息,打印blockInfo可以吗 |
文件里面已经是最全的信息了,界面里面的所有信息都来自文件 |
你好,我的项目不是运行在手机上的,无法展示出结果的那个界面,请问如果我想把结果写入一个文件中,在哪修改呢
The text was updated successfully, but these errors were encountered: