Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global uncaught exception handler -> email log to me?

Tags:

android

Is there any way to catch crashes in my own android app? Something like a global uncaught exception handler? Just wondering if I could install something like that, then if an uncaught exception is thrown, I could pop up a dialog for the user and ask if they want to mail a dump of the exception to me.

Thanks

like image 952
user246114 Avatar asked Apr 16 '10 15:04

user246114


People also ask

What is uncaught exception handler?

Interface for handlers invoked when a Thread abruptly terminates due to an uncaught exception. When a thread is about to terminate due to an uncaught exception the Java Virtual Machine will query the thread for its UncaughtExceptionHandler using Thread.

How is the uncaught exception handled?

There are a number of things you need to do: Handle uncaughtException in your Application subclass. After catching an exception, start a new activity to ask the user to send a log. Extract the log info from logcat's files and write to your own file.

What is global error handling?

The global error handler is used catch all errors and remove the need for duplicated error handling code throughout the . NET api. It's configured as middleware in the configure HTTP request pipeline section of the Program.

What are uncaught exceptions?

Editorial Staff. June 01, 2022. CWE 248-Uncaught Exception occurs when an exception is not caught by a programming construct or by the programmer, it results in an uncaught exception. In Java, for example, this would be an unhandled exception that would terminate the program.


2 Answers

Is there any way to catch crashes in my own android app? Something like a global uncaught exception handler?

See Thread.setDefaultUncaughtExceptionHandler().

Just wondering if I could install something like that, then if an uncaught exception is thrown, I could pop up a dialog for the user and ask if they want to mail a dump of the exception to me.

You can also use Flurry, DroidDrop, or any of the other implementations of this already available.

like image 115
CommonsWare Avatar answered Nov 26 '22 02:11

CommonsWare


Bugsense.com also does this (for free)

like image 35
Jon Romero Avatar answered Nov 26 '22 03:11

Jon Romero