Send Log file when app crashed by runtime exception
Although we have tested your app before releasing to others or the public, there still are hidden bugs that cause running exceptions we did not catch. Eventually, the app crashed. We want to know what has happened and try to fix it. Therefore, we need the app to send the log file from the installed device to us. Below is an example to send the log file stored in app-specific storage to a dedicated email address when the app crashed by the runtime exception. For the method of saving log messages into files, please check the previous post Logging in Android . Create a subclass of Application class to catch the unknown runtime exception Application class is the first class to be invoked before any other class when the app starts because it is the base class of maintaining global application state. Our purpose is to add a concrete class of Thread.UncaughtExceptionHandler when the app starts. The inte...