Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to catch my application's crash report

Tags:

android

I am developing android application. I want to send an email to myself whenever my app crashes on a device, so that I can find my application's crash report through email. How can I implement this concept in my app? Have any exception handler for it?

like image 621
John Avatar asked Sep 10 '11 10:09

John


People also ask

How do I check my application crash report?

Find your data Select an app. On the left menu, select Quality > Android vitals > Crashes and ANRs. Near the center of your screen, use the filters to help you find and diagnose issues. Alternatively, select a cluster to get more details about a specific crash or ANR error.

Where can I find Steam game crash reports?

You can view the details of each crash on the Error Reports page of the Steamworks Partner backend. Mini-dumps are always stored locally on the computer before they are uploaded to Steam. If you need to examine one directly, you should be able to find it in the games install directory.


2 Answers

I am catching un-handled exceptions by using this in my activity's onCreate():

mUEHandler = new Thread.UncaughtExceptionHandler() {

        @Override
        public void uncaughtException(Thread t, Throwable e) {
            try {

                PrintWriter pw = new PrintWriter(new OutputStreamWriter(
                        openFileOutput(DMP_FILENAME, 0)));
                e.printStackTrace(pw);
                pw.flush();
                pw.close();
            } catch (FileNotFoundException e1) {
                // do nothing
            }
            BaseActivity.this.finish();
        }
    };

    Thread.setDefaultUncaughtExceptionHandler(mUEHandler);

This writes every unhandled exception in your app that happened on your activity to text file. Then you can analyze it.

like image 131
gordonfreeman Avatar answered Oct 04 '22 22:10

gordonfreeman


I use ACRA http://code.google.com/p/acra/ to collect crash reports. Since these are collected into Google docs-based spreadsheet you can configure to be notified when that doc is updated

like image 22
Bostone Avatar answered Oct 04 '22 20:10

Bostone