0

My android app is crash after deployment to production. we implementd crash log report to send hockey by asking user to send with prompt dialog . Problem is that after crash occurs, app cannot launch and activity cannot start. So prompt cannot show and user cannot send crash report.

jerry
  • 45
  • 12

2 Answers2

1

You can either use some crashlytic tool like Fabric to track crashes automatically or you can yourself handle UncaughtExceptions in your project and prompt user an alert, when ever a crash happens, to submit a bug report.

Put the following code in Application class of your project

/**
 * To catch all unCaught Exception.
 */
private Thread.UncaughtExceptionHandler unCaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
    @Override
    public void uncaughtException(Thread thread, Throwable ex) {
      // show an alert to user to submit a bug report or do some other stuff
    }


};

And in onCreate meathod of Application class do the following

@Override
public void onCreate() {
    super.onCreate();
    Thread.setDefaultUncaughtExceptionHandler(unCaughtExceptionHandler);
}
Nitesh
  • 3,868
  • 1
  • 20
  • 26
0

There are multiple option which you can implement but you need to analyze according to your needs :

Option 1 : Firebase :

You can gr thruough this link which give a detailed explaination of integrating the firebase crash reporting. Its easy and can be done in not more than 1 hour

https://code.tutsplus.com/tutorials/android-from-scratch-firebase-crash-reporting--cms-27167

Option 2 : Crashlytics : You can go through the documentation to integrate the same on the below link

https://fabric.io/kits/android/crashlytics

There are other crash reporting tools such as appdynamics, as well but I prefer using above two for my projects. In case you need to see more option go through this link https://appsamurai.com/7-crash-reporting-tools-for-ios-and-android-apps/

here is a comparision for both of them

Crash Firebase vs Crashlytics vs HockyApp

https://medium.com/google-developer-experts/firebase-crash-reporting-vs-crashlytics-a6c287c4b792

MRX
  • 1,400
  • 3
  • 12
  • 32