我正在使用ACRA 4.8进行android崩溃报告。在配置中,他们表示实现自己的服务器。我无法理解。有人能帮我吗。
请参阅下面的文档。
https://github.com/ACRA/acra/wiki/Report-Destinations#implementing-your-own-sender
目前我的代码如下所示,请修改或举例说明。
import org.acra.ACRA;
import org.acra.ReportField;
import org.acra.ReportingInteractionMode;
import org.acra.annotation.ReportsCrashes;
import org.acra.collector.CrashReportData;
import org.acra.sender.HttpSender;
import org.acra.sender.ReportSender;
import org.acra.sender.ReportSenderException;
@ReportsCrashes(
formUri = "https://vooratarun.cloudant.com/acra-gingerbuds/_design/acra-storage/_update/report",
reportType = HttpSender.Type.JSON,
httpMethod = HttpSender.Method.POST,
formUriBasicAuthLogin = "tonsedsollsoonseciablest",
formUriBasicAuthPassword = "f6c7edefcf5cee94972d63d996be8ab3ee3b9f5d",
// 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.DEVICE_ID,
ReportField.CUSTOM_DATA,
ReportField.CRASH_CONFIGURATION,
ReportField.USER_APP_START_DATE,
ReportField.USER_COMMENT,
ReportField.USER_IP,
},
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.toast_crash
)
public class AppController extends Application {
public static final String TAG = AppController.class.getSimpleName();
private RequestQueue mRequestQueue;
private ImageLoader mImageLoader;
private static AppController mInstance;
public static Context getContext() {
return mInstance;
}
@Override
public void onCreate() {
super.onCreate();
ACRA.init(this);
String deviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
ACRA.getErrorReporter().putCustomData("DeviceID", deviceId);
// ACRA.getErrorReporter().handleException(null);
mInstance = this;
AnalyticsTrackers.initialize(this);
AnalyticsTrackers.getInstance().get(AnalyticsTrackers.Target.APP);
}
}