リンクに記載されているように、Android 2.2 の時点で、クラッシュ レポートを送信するための新しい機能があるようです。
- http://www.androidcentral.com/new-android-app-crash-report-tool-already-and-running
- http://android-developers.blogspot.com/2010/05/google-feedback-for-android.html
- http://developer.android.com/sdk/android-2.2-highlights.html
- http://www.youtube.com/watch?v=o8unC9bA4O8
この機能を使用するにはどうすればよいですか? 市場 (別名 Google Play ストア) からダウンロードされたアプリケーションごとに自動的に行われますか? この機能に関する詳細情報はどこにありますか?
また、おそらく DefaultExceptionHandler を使用して、送信される内容をカスタマイズし、クラッシュに関する独自の説明を追加することは可能ですか?
注:クラッシュレポートを送信するためのツール( ACRAなど)がたくさんあることは知っていますが、すでに提供されているものを使用できるかどうかを最初に確認したいと思います。
編集:さらに渡された例外の変更に成功しました。これにより、Google の開発者 Web サイトに送信されるレポートも変更されることを期待しています。
これに関連するサンプル コードを次に示します。
private static class DefaultExceptionHandler implements java.lang.Thread.UncaughtExceptionHandler
...
@Override
public void uncaughtException(Thread t, Throwable e)
{
final StackTraceElement[] exceptionStackTrace = e.getStackTrace();
Exception exception = new Exception("my new exception!", e);
final StackTraceElement[] newExceptionStackTrace = new StackTraceElement[exceptionStackTrace.length + 1];
System.arraycopy(exceptionStackTrace, 0, newExceptionStackTrace, 1, exceptionStackTrace.length);
newExceptionStackTrace[0] = new StackTraceElement("TEST CLASS", "TEST METHOD", "TEST FILE", 0);
exception.setStackTrace(newExceptionStackTrace);
_defaultUEH.uncaughtException(t, exception); //this will hopefully call the default handling of the exception for reporting
}