我正在尝试在我的测试应用程序(Lollipop)中使用Android中的ACRA来获得基本的报告。
到目前为止,我实施了以下措施:
(顺便说一句,很抱歉上面的代码格式化,但是StackOverflow出于某种原因拒绝正确地格式化它)
这是基于github https://github.com/ACRA/acra/wiki/BasicSetup中提供的ACRA文档。
我希望看到某种通知和某种报告的生成,但我没有得到任何。我的应用程序只是在尝试零除法的地方崩溃。
我不知道我做错了什么。
谢谢,
发布于 2015-10-27 05:43:34
应选择的通知类型为
mode = ReportingInteractionMode.TOAST,
//Available : Dialog,Notification,Toast and Silent
resToastText = R.string.crash_text_toast下面是我在我的应用程序中使用的示例报表参数。
@ReportsCrashes(
formUri="",
formUriBasicAuthLogin = "CloundantAuthLogin",
formUriBasicAuthPassword = "CloundantAuthKeyPassword",
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.PUT,
customReportContent = { ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL,ReportField.DEVICE_FEATURES,
ReportField.USER_APP_START_DATE,ReportField.USER_CRASH_DATE,ReportField.TOTAL_MEM_SIZE,ReportField.USER_COMMENT,
ReportField.THREAD_DETAILS, ReportField.STACK_TRACE },
mode = ReportingInteractionMode.DIALOG,
includeDropBoxSystemTags = true,
resToastText = R.string.crash_toast_text, // optional, displayed as soon as the crash occurs, before collecting data which can take a few seconds
resDialogText = R.string.crash_dialog_text,
resDialogIcon = android.R.drawable.ic_dialog_info, //optional. default is a warning sign
resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional. when defined, adds a user text field input with this text resource as a label
resDialogOkToast = R.string.crash_dialog_ok_toast // optional. displays a Toast message when the user accepts to send a report.
)使用的图书馆: acra-4.6.2
这里提供的最好的教程是:http://www.toptal.com/android/automated-android-crash-reports-with-acra-and-cloudant
https://stackoverflow.com/questions/33357506
复制相似问题