In my android app I need a global exception handling mechanism. That is an exception handler which works when an exception occurs from any activity of my app. Is this possible? How?
Asked
Active
Viewed 880 times
2 Answers
1
if you have access to your own web server with PHP installed, you might have a look at this

Kernel Panic
- 11
- 2
0
The Google Groups thread they're pointing you to is a good reference. I have a helper class in my app that offers the user the option of sending a failure report to me with the details of the crash. Basically, when the failure is caught it writes the details out to the SD card and on next run of the app it displays a pop-up.
It won't keep your app from crashing, but it will let you do something intelligent with result.

Bill Mote
- 12,644
- 7
- 58
- 82
-
1That is really handy! You write all the exceptions caught to the SD card and then send it when the program is started next time? Not entirely sure how you do that, but definitely going to look into that. Feel free to share any source if you got it lying around.:) – Codemonkey Mar 10 '11 at 13:36
-
Sorry Klaus, but it's not really my code to share. It was given to me by a friend. I get a very thorough e-mail with details about the device, OS version, stack, cause, etc. It has been incredibly helpful. In fact, using the data gleaned from the crash reports I have eliminated all Force Close and Freeze issues in my app (to date.) It's been ~3 weeks since the last error (as reported by the developer console.) – Bill Mote Mar 10 '11 at 15:45
-
Wow, impressive! Definitely something I would like to implement in my application. No worries about the code - if it's not public domain, it's not public domain. :) – Codemonkey Mar 10 '11 at 16:18