android ACRA 4.8 崩溃报告实现自己的服务器

android ACRA 4.8 crash report implement own server

我将 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);
    }
}

ACRA 维基 link 您的贡献是针对 Implement your own ***sender*** 而不是服务器。

实施您自己的发件人意味着实施 org.acra.sender.ReportSender 并在您的 ACRA 配置中声明它。然后,ACRA 将在需要调度崩溃时调用 class。