Custom ACRA for Android URL when sending report to server itself?

I am using ACRA for Android and I want to send crash reports to my own server. I set everything up and everything works fine. However, I would like to make a URL to send reports to custom. But I do not know how to do this.

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 {
    ...

Basically, I cannot configure formUrifrom the application. Is it possible?

+5
source share
4 answers

Perhaps I was lucky enough to ask a question because I found how to do it myself ... But the URL can be changed using the following line of code:

    ErrorReporter.getInstance().setReportSender(new HttpPostSender(newAddress, null));

Edit: Old answer, see bendvds updated answer

+3

, ErrorReporter.getInstance , . ACRA.init.

ACRAConfiguration config = ACRA.getConfig();
config.setFormUri("http://server.com/script");
ACRA.setConfig(config);
+9

benvd, .

ACRA.getConfig() @ReportsCrashes, . ACRA.getNewDefaultConfig() , Uri.

ACRAConfiguration config = ACRA.getNewDefaultConfig();
config.setFormUri("http://server.com/script");
ACRA.setConfig(config);
0

, ACRA:

@ReportsCrashes . ADT 17, Android Library ACRA - , . ACRA .

ACRA.getConfig() ACRAConfiguration, @ReportsCrashes.

You can even use ACRA.getNewDefaultConfig (Application) to create a new configuration object initialized with default values ​​+ values ​​set in your annotation options, change some values, save the object in memory for later use and set it to ACRA. setConfig (ACRAConfiguration) if necessary.

0
source

All Articles