I'm using ACRA for Android, and I want to send the crash reports to my own server. I've set it up alright, and everything works fine. However, I would like to make the URL that the reports are sent to configurable. But I do not know how to do it.
Here is the code I use to set the URL
@ReportsCrashes(formKey = "", // will not be used
formUri = "http://yourserver.com/yourscript",
formUriBasicAuthLogin = "yourlogin", // optional
formUriBasicAuthPassword = "y0uRpa$$w0rd", // optional
mode = ReportingInteractionMode.TOAST,
resToastText = R.string.crash_toast_text)
public class MyApplication extends Application {
...
So basically, I wan't to be able to configure formUri
from within the application. Is it possible?
It seems ErrorReporter.getInstance is now deprecated, but the following lines have the same effect. Execute them before calling ACRA.init.
ACRAConfiguration config = ACRA.getConfig();
config.setFormUri("http://server.com/script");
ACRA.setConfig(config);
Maybe I was a bit quick to post a question, because I found how to do it by myself... But the URL can be changed with the following line of code:
ErrorReporter.getInstance().setReportSender(new HttpPostSender(newAddress, null));
Edit: Old answer, see bendvds updated answer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With