Use this custom class:
public class AcraCustomSender implements ReportSender {
Context activity;
@Override
public void send(Context context, CrashReportData errorContent) throws ReportSenderException {
activity=context;
String crashReport = "";
try {
JSONObject object = errorContent.toJSON();
Log.e("acra", object.toString());
crashReport = object.toString();
}catch (JSONReportBuilder.JSONReportException e) {
e.printStackTrace();
}
//the string crashreport contains your crash log. you can pass it to your own backend.
}
}
Create another class for your application:
public class YourApplication extends Application {
@Override
public void onCreate() {
try {
ACRA.init(this);
AcraCustomSender yourSender = new AcraCustomSender();
ACRA.getErrorReporter().setReportSender(yourSender);
super.onCreate();
}catch (Exception ex) {
ex.printStackTrace();
}
}
}
Now, whenever app crashes you can get it in AcraCustomSender class, and do whatever you want to do(like sending to your own DB)