Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send crash reports to developer?

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 ?

like image 409
Mohammad Rababah Avatar asked Mar 18 '14 07:03

Mohammad Rababah


1 Answers

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.

like image 99
NullPointerException Avatar answered Oct 04 '22 14:10

NullPointerException