ACRA概述
介绍
在Android开源库和开源项目一文中,介绍了不少开源项目。其中ACRA是一个Android平台程序崩溃信息收集的开源库,用于嵌入到Android Project中,当该程序崩溃的时候ACRA能够在进程彻底结束前收集崩溃状态时的该应用和设备的各种信息,生成崩溃报告,保存到本地,并在合适的时机发送报告到服务端。使得开发者能进行程序错误信息的收集,可以更好的改进程序以提高兼容性,目前只能支持采集java层的crash,要采集native层需要考虑集成breakpad
github
https://github.com/ACRA/acra
wiki
https://github.com/ACRA/acra/wiki
历史版本
目前的最新版本是5.3.0 (2019年3月23日)
ACRA设计
主要模块
package |
module |
comments |
acra-advanced-scheduler |
|
schedule when to send |
acra-core |
org.acra.attachment |
|
acra-core |
org.acra.builder |
构建 |
acra-core |
org.acra.collector |
信息采集类 |
acra-core |
org.acra.config |
配置 |
acra-core |
org.acra.data |
崩溃报告的数据结构和创建 |
acra-core |
org.acra.file |
崩溃报告的保存 |
acra-core |
org.acra.interaction |
发送前的交互管理 |
acra-core |
org.acra.legacy |
日志遗留,历史报告转成最新报告格式 |
acra-core |
org.acra. plugins |
|
acra-core |
org.acra.prefs |
acra的配置保存 |
acra-core |
org.acra.reporter |
崩溃报告的入口 |
acra-core |
org.acra.scheduler |
|
acra-core |
org.acra.sender |
崩溃报告发送类库,SenderService在此 |
acra-core |
org.acra.startup |
|
acra-core |
org.acra.util |
|
acra-dialog |
|
发送交互为dialog |
acra-http |
|
崩溃报告通过http发送 |
acra-limiter |
|
|
acra-mail |
|
崩溃报告通过邮件发送 |
acra-notification |
|
崩溃报告弹通知来通知 |
acra-toast |
|
崩溃报告弹toast通知 |
对外主要接口
class |
org.acra.ACRA |
method |
init |
fields |
|
class |
org.acra.config.CoreConfigurationBuilder |
method |
|
fields |
|
class |
org.acra.config.CoreConfiguration |
method |
|
fields |
|