如何发送错误报告给开发者? [英] How to send crash reports to developer?

查看:640
本文介绍了如何发送错误报告给开发者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发Android应用,但在某些情况下,我的应用程序强制关闭

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 ?

推荐答案

借助 ACRA 库将满足您的要求。你只需要设置邮件。本教程和设置定义这里

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

以.jar下载库LIB

Download the library with .jar in lib

您只需要定义应用程序类,并用以下code略高于应用类和重写的onCreate()方法类似这样

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 = "reports@yourdomain.com",
                    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.

这篇关于如何发送错误报告给开发者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆