Question:
I want all exceptions that can occur in the application while the user is running to be sent to the Andoid Developer Console. Let's say that information about an exception is sendFeedback()
using the sendFeedback()
method. And here the question arises: where should this sendFeedback()
method be located, taking into account the fact that this method will be used throughout the application? And how do you use it? I have two assumptions:
- in the
Application
class (and then, in eachcatch
-e of eachtry-catch
call this method) - in a class that implements the
java.lang.Thread.UncaughtExceptionHandler
interface (and then callThread.setDefaultUncaughtExceptionHandler(...)
in eachThread.setDefaultUncaughtExceptionHandler(...)
)
How correct is this? Or are both bad, and better done in some other way?
Answer:
Why don't you use a ready-made solution like https://fabric.io ? It connects it to its application, and from all devices begins to receive statistics about falls. Very handy little thing