看來,由於Android 2.2的,有用於發送崩潰報告的一個新功能,如鏈接中提到:Android - 如何發送崩潰報告?
- 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的開發人員網站的報告。
下面是一個示例代碼,是有關這個:你現在已經在功能描述聽起來像身材,而據我所知,你不能自定義此
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
}
你會在市場控制檯中自動收到錯誤報告。 –