How to send crash reports to developer?

mohammad rababah picture mohammad rababah · Mar 18, 2014 · Viewed 11.2k times · Source

I develop android app but in some cases my app force close

How can I send email to developer contains details if force close happen in any time ?

Answer

NullPointerException picture NullPointerException · Mar 18, 2014

The ACRA library will fulfill your requirement. You just need to setup the email. The tutorial and setup is defined here.

Download the library with .jar in lib

You just need to define the Application class and write the following code just above application class and override onCreate() method like this

     @ReportsCrashes(formKey = "", // will not be used
                    mailTo = "[email protected]",
                    mode = ReportingInteractionMode.TOAST,
                    resToastText = R.string.crash_toast_text)
    public class MyApplication extends Application {

 @Override
    public void onCreate() {
        ACRA.init(this);
        super.onCreate();
    }

}

Thats it. The email action will get opened whose body contains crash report.