|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectApplication
org.acra.CrashReportingApplication
public abstract class CrashReportingApplication
Base class for any application which need to send crash reports. The final
application has to extend this class and at least implement the abstract
method getFormId()
by returning a valid GoogleDocs Form id string
generated by importing ACRA's specific spreadsheet template.
If you prefer sending crash reports to your own script on your own server,
you can override getFormUri()
and return any Url string to your
sever script (like : "http://www.myserver.com/myscript.php").
If some crash reports could not be sent (due to technical issues like loss of network connection), their data is stored in the application private filesystem and sent on the next Application start. This means that the reports might be sent quite some time after the crash, because a crash causes the Activity to be destroyed but not the Application.
If you would like to receive reports as soon as possible, you may want to
call ErrorReporter.checkReportsOnApplicationStart()
on
ErrorReporter.getInstance()
in your main Activity
onCreate()
method.
Field Summary | |
---|---|
static int |
NOTIF_CRASH_ID
This is the identifier (value = 666) use for the status bar notification issued when crashes occur. |
static java.lang.String |
PREF_DISABLE_ACRA
The key of the application default SharedPreference where you can put a 'true' Boolean value to disable ACRA. |
static java.lang.String |
RES_DIALOG_COMMENT_PROMPT
Bundle key for the user comment input label in the crash dialog. |
static java.lang.String |
RES_DIALOG_ICON
Bundle key for the icon in the crash dialog. |
static java.lang.String |
RES_DIALOG_OK_TOAST
Bundle key for the Toast text triggered when the user accepts to send a report in the crash dialog. |
static java.lang.String |
RES_DIALOG_TEXT
Bundle key for the text in the crash dialog. |
static java.lang.String |
RES_DIALOG_TITLE
Bundle key for the title in the crash dialog. |
static java.lang.String |
RES_NOTIF_ICON
Bundle key for the icon in the status bar notification. |
static java.lang.String |
RES_NOTIF_TEXT
Bundle key for the text in the status bar notification. |
static java.lang.String |
RES_NOTIF_TICKER_TEXT
Bundle key for the ticker text in the status bar notification. |
static java.lang.String |
RES_NOTIF_TITLE
Bundle key for the title in the status bar notification. |
static java.lang.String |
RES_TOAST_TEXT
Bundle key for the Toast text triggered when the application crashes if the notification+dialog mode is not used. |
Constructor Summary | |
---|---|
CrashReportingApplication()
|
Method Summary | |
---|---|
Bundle |
getCrashResources()
Override this method to activate user notifications. |
abstract java.lang.String |
getFormId()
Implement this method by returning a String containing the id of a valid GoogleDocs Form. |
Uri |
getFormUri()
Override this method to send the crash reports to your own server script. |
void |
onCreate()
|
void |
onSharedPreferenceChanged(SharedPreferences sharedPreferences,
java.lang.String key)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RES_NOTIF_ICON
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_NOTIF_TICKER_TEXT
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_NOTIF_TITLE
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_NOTIF_TEXT
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_DIALOG_ICON
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_DIALOG_TITLE
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_DIALOG_TEXT
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_DIALOG_COMMENT_PROMPT
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_DIALOG_OK_TOAST
getCrashResources()
,
Constant Field Valuespublic static final java.lang.String RES_TOAST_TEXT
getCrashResources()
,
Constant Field Valuespublic static final int NOTIF_CRASH_ID
public static final java.lang.String PREF_DISABLE_ACRA
Constructor Detail |
---|
public CrashReportingApplication()
Method Detail |
---|
public void onCreate()
public Uri getFormUri()
Override this method to send the crash reports to your own server script.
Your script will have to get HTTP POST request parameters named as
described in ErrorReporter
source code (*_KEY fields values).
If you override this method with your own url, your implementation of the
abstract getFormId()
can be empty as it will not be called by
any other method or object.
public abstract java.lang.String getFormId()
public Bundle getCrashResources()
RES_TOAST_TEXT
to activate the Toast notification modeRES_NOTIF_TICKER_TEXT
, RES_NOTIF_TEXT
,
RES_NOTIF_TITLE
and RES_DIALOG_TEXT
to activate status
bar notifications + dialog mode. You can additionally set
RES_DIALOG_COMMENT_PROMPT
to activate an input field for the
user to add a comment. Use RES_NOTIF_ICON
,
RES_DIALOG_ICON
, RES_DIALOG_TITLE
or
RES_DIALOG_OK_TOAST
for further UI tweaks.
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, java.lang.String key)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |