如何使用Couchdb配置CUSTOM_DATA字段?
我想设置一个配置值与错误一起发送。在后端,我有一个带有ACLARYZER Web应用程序的沙发数据库。
这是我在Android的Application.class上定义此自定义数据值的代码。
@ReportsCrashes(
formUri = "https://user.cloudant.com/acra-report/_design/acra-storage/_update/report",
reportType = HttpSender.Type.JSON,
httpMethod = HttpSender.Method.POST,
formUriBasicAuthLogin = "user",
formUriBasicAuthPassword = "pass",
formKey = "", // This is required for backward compatibility but not used
customReportContent = {
ReportField.APP_VERSION_CODE,
ReportField.APP_VERSION_NAME,
ReportField.ANDROID_VERSION,
ReportField.PACKAGE_NAME,
ReportField.REPORT_ID,
ReportField.BUILD,
ReportField.STACK_TRACE,
ReportField.CUSTOM_DATA
},
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.reporte_error
)
public class my_applicaction extends Application{
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
ACRA.init(my_applicaction.this);
ACRA.getErrorReporter().putCustomData("myKey", "myValue");
ACRA.getErrorReporter().handleException(null);
}
}
Run Code Online (Sandbox Code Playgroud)
现在的问题是如何在沙发数据库中添加值以获取此自定义数据字段。还是我必须在ACRALYZER中定义自定义数据?
谢谢?
我试图发送ACRA异常报告,而不关闭应用程序,但它仍然关闭应用程序并显示对话框.
我发送这样的异常报告.
ACRA.getErrorReporter().handleException(finalException, false);
Run Code Online (Sandbox Code Playgroud)
第二个参数负责关闭应用程序.但它仍然显示对话框和应用程序关闭.
这是我的配置,但我认为它不会有用
@ReportsCrashes(
reportType = org.acra.sender.HttpSender.Type.JSON,
httpMethod = org.acra.sender.HttpSender.Method.POST,
mode = ReportingInteractionMode.DIALOG,
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.
formUri = "aaaaaaaaa",
formUriBasicAuthLogin = "oooooooo", …Run Code Online (Sandbox Code Playgroud)