How Does Google Play Capture Exceptions From Our Mobile?
I am wondering how would a Google play is capable of capturing list of errors occuring in the applications it has and showing it to the developer? Backdrop: We are trying to replic
Solution 1:
I assume Android applications are tied to Google Play market so that when exceptions occurs, the crash report to be sent to them.
One possible solution would be to let your users implement some kind of library in order to publish apps on your market. That library should do nothing but catch exceptions and send crash reports to your servers (something like ACRA).
Though, as a developer, I don't think this approach is one good, unless you offer something very promising to developers (like app visibility, promotion, etc)
Solution 2:
I do not know how Google Play does it, but for my needs I create my own java.lang.Thread.UncaughtExceptionHandler
:
classMyUncaughtExceptionHandlerimplementsUncaughtExceptionHandler {
privateUncaughtExceptionHandler mDefaultUncaughtExceptionHandler;
MyUncaughtExceptionHandler() {
mDefaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
}
@OverridepublicvoiduncaughtException(Thread aThread, Throwable aThrowable) {
// do your stuff
mDefaultUncaughtExceptionHandler.uncaughtException(aThread, aThrowable);
}
}
And register it in android.app.Application#onCreate
.
@OverridepublicvoidonCreate() {
super.onCreate();
Thread.setDefaultUncaughtExceptionHandler(newUncaughtExceptionHandler());
}
Post a Comment for "How Does Google Play Capture Exceptions From Our Mobile?"