|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acra.ErrorReporter
public class ErrorReporter
The ErrorReporter is a Singleton object in charge of collecting crash context
data and sending crash reports. It registers itself as the Application's
Thread default Thread.UncaughtExceptionHandler
.
When a crash occurs, it collects data of the crash context (device, system, stack trace...) and writes a report file in the application private directory. This report file is then sent :
mReportingInteractionMode
is set to
ReportingInteractionMode.SILENT
or
ReportingInteractionMode.TOAST
,mReportingInteractionMode
is
set to ReportingInteractionMode.NOTIFICATION
.
Constructor Summary | |
---|---|
ErrorReporter()
|
Method Summary | |
---|---|
void |
addCustomData(java.lang.String key,
java.lang.String value)
Use this method to provide the ErrorReporter with data of your running application. |
void |
checkReportsOnApplicationStart()
This method looks for pending reports and does the action required depending on the interaction mode set. |
void |
deletePendingReports()
Delete all report files stored. |
void |
disable()
Disable ACRA : sets this Thread's Thread.UncaughtExceptionHandler back
to the system default. |
static long |
getAvailableInternalMemorySize()
Calculates the free memory of the device. |
static ErrorReporter |
getInstance()
Create or return the singleton instance. |
static long |
getTotalInternalMemorySize()
Calculates the total memory of the device. |
void |
handleException(java.lang.Throwable e)
Send a report for this Throwable. |
void |
handleSilentException(java.lang.Throwable e)
|
void |
init(Context context)
This is where the ErrorReporter replaces the default Thread.UncaughtExceptionHandler . |
void |
setFormUri(Uri formUri)
Use this method to provide the Url of the crash reports destination. |
void |
uncaughtException(java.lang.Thread t,
java.lang.Throwable e)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ErrorReporter()
Method Detail |
---|
public void setFormUri(Uri formUri)
formUri
- The Url of the crash reports destination (HTTP POST).public void addCustomData(java.lang.String key, java.lang.String value)
Use this method to provide the ErrorReporter with data of your running application. You should call this at several key places in your code the same way as you would output important debug data in a log file. Only the latest value is kept for each key (no history of the values is sent in the report).
The key/value pairs will be stored in the GoogleDoc spreadsheet in the "custom" column, as a text containing a 'key = value' pair on each line.
key
- A key for your custom data.value
- The value associated to your key.public static ErrorReporter getInstance()
public void init(Context context)
This is where the ErrorReporter replaces the default
Thread.UncaughtExceptionHandler
.
context
- The android application context.public static long getAvailableInternalMemorySize()
public static long getTotalInternalMemorySize()
public void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
uncaughtException
in interface java.lang.Thread.UncaughtExceptionHandler
public void handleException(java.lang.Throwable e)
e
- The Throwable to be reported. If null the report will contain
a new Exception("Report requested by developer").public void handleSilentException(java.lang.Throwable e)
public void checkReportsOnApplicationStart()
public void deletePendingReports()
public void disable()
Thread.UncaughtExceptionHandler
back
to the system default.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |