1

I have been writing a simple Android application (one Activity).

I would really like to gather crash reports from actual user sessions. I know there are some nice 3rd-party libraries. I also read that Google Play Console (Android vitals) should be providing some basic telemetry including crash reports. I was thinking that, to keep things simple, I would stick with the Android vitals for now.

I was wondering whether there is anything I need to do on the Application side to get the crash reports. Or should I just simply let the App crash?

I handle exception that can be handled, but there is always a possibility that one makes it to, say, onCreate. 'onCreate' does not allow throwing checked exceptions though. If I cannot handle it, should I just wrap it in Runtime exception and throw that instead?

Thanks.

Petr
  • 1,128
  • 2
  • 14
  • 23
  • Please could you clarify _why_ you would like to gather crash reports? what would the aim be of having these crash reports? Also, what would you like the user to experience when you trigger a crash? From what I understand, you would only receive crash reports in Android Vitals when 3 factors align: 1) the app has an unhandled exception and is terminated by the Operating System, 2) the user agrees to it being sent to Google, 3) there are enough crashes to exceed Google's threshold for privacy. – JulianHarty May 27 '19 at 19:36

1 Answers1

0

Here's an article for a similar approach, https://proandroiddev.com/hide-your-crashes-gracefully-and-still-report-them-9b1c85b25875 However it does not rely on the Android OS crash reporting process; i.e. I don't think you would see the crashes in Android Vitals if you follow the steps described in the article.

You might be able to adapt it though, mainly in terms of restarting the app after the crash occurs.

JulianHarty
  • 3,178
  • 3
  • 32
  • 46