org.acra.annotation
Annotation Type ReportsCrashes


@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
@Inherited
public @interface ReportsCrashes

Provide configuration elements to the ACRA.init(android.app.Application) method. The only mandatory configuration item is the formKey() parameter which is the Id of your Google Documents form which will receive reports.

Author:
Kevin Gaudin

Required Element Summary
 String formKey
           
 
Optional Element Summary
 String[] additionalDropBoxTags
           
 String[] additionalSharedPreferences
          Add here your SharedPreferences identifier Strings if you use others than your application's default.
 String applicationLogFile
          To use in combination with ReportField.APPLICATION_LOG to set the path/name of your application log file.
 int applicationLogFileLines
          To use in combination with ReportField.APPLICATION_LOG to set the number of latest lines of your application log file to be collected.
 int connectionTimeout
           
 ReportField[] customReportContent
           Redefines the list of ReportFields collected and sent in your reports.
 boolean deleteOldUnsentReportsOnApplicationStart
          This property can be used to determine whether old (out of date) reports should be sent or not.
 boolean deleteUnapprovedReportsOnApplicationStart
          Controls whether unapproved reports are deleted on application start or not.
 boolean disableSSLCertValidation
           Set this to true if you need to post reports to your own server using an SSL connection with a self-signed certificate.
 int dropboxCollectionMinutes
           
 String[] excludeMatchingSettingsKeys
          Provide here regex patterns to be evaluated on each Settings.System, Settings.Secure and Settings.Global key to exclude KV pairs from the collected SharedPreferences.
 String[] excludeMatchingSharedPreferencesKeys
          Provide here regex patterns to be evaluated on each SharedPreference key to exclude KV pairs from the collected SharedPreferences.
 boolean forceCloseDialogAfterToast
          In ReportingInteractionMode.TOAST mode, set this to true if you prefer displaying the native Force Close dialog after the Toast.
 String formUri
          The Uri of your own server-side script that will receive reports.
 String formUriBasicAuthLogin
          When using the formUri() parameter to send reports to a custom server-side script, you can set here and in formUriBasicAuthPassword() the credentials for a BASIC HTTP authentication.
 String formUriBasicAuthPassword
          When using the formUri() parameter to send reports to a custom server-side script, you can set here and in formUriBasicAuthLogin() the credentials for a BASIC HTTP authentication.
 String googleFormUrlFormat
           Default behavior is to send reports to an URL following the format: "https://spreadsheets.google.com/formResponse?
 HttpSender.Method httpMethod
           The HttpSender.Method to be used when posting with formKey().
 boolean includeDropBoxSystemTags
          If enabled, DropBox events collection will include system tags: system_app_anr system_app_wtf system_app_crash system_server_anr system_server_wtf system_server_crash BATTERY_DISCHARGE_INFO SYSTEM_RECOVERY_LOG SYSTEM_BOOT SYSTEM_LAST_KMSG APANIC_CONSOLE APANIC_THREADS SYSTEM_RESTART SYSTEM_TOMBSTONE data_app_strictmode
 String[] logcatArguments
           Arguments to be passed to the logcat command line.
 boolean logcatFilterByPid
          Set this to true if you want to include only logcat lines related to your Application process.
 String mailTo
           Add your crash reports mailbox here if you want to send reports via email.
 int maxNumberOfRequestRetries
           
 ReportingInteractionMode mode
           The interaction mode you want to implement.
 HttpSender.Type reportType
           
 int resDialogCommentPrompt
           
 int resDialogEmailPrompt
           
 int resDialogIcon
           
 int resDialogOkToast
           
 int resDialogText
           
 int resDialogTitle
           
 int resNotifIcon
           
 int resNotifText
           
 int resNotifTickerText
           
 int resNotifTitle
           
 int resToastText
          Resource id for the Toast text triggered when the application crashes if the ReportingInteractionMode.TOAST mode is used.
 boolean sendReportsInDevMode
          Set this to false if you want to disable sending reports in development mode.
 int sharedPreferencesMode
          If using a custom sharedPreferencesName(), pass here the mode that you need for the SharedPreference file creation: Context.MODE_PRIVATE, Context.MODE_WORLD_READABLE or Context.MODE_WORLD_WRITEABLE.
 String sharedPreferencesName
           
 int socketTimeout
          If the request is retried due to timeout, the socketTimeout will double before retrying the request.
 

Element Detail

formKey

public abstract String formKey
Returns:
The id of the Google Doc form.

formUri

public abstract String formUri
The Uri of your own server-side script that will receive reports. This is to use if you don't want to send reports to Google Docs but to your own, self-hosted script.

Returns:
URI of a custom server to which to post reports.
Default:
""

mode

public abstract ReportingInteractionMode mode

The interaction mode you want to implement. Default is ReportingInteractionMode.SILENT which does not require any resources configuration.

Other modes have resources requirements:

Returns:
the interaction mode that you want ACRA to implement.
Default:
org.acra.ReportingInteractionMode.SILENT

resDialogCommentPrompt

public abstract int resDialogCommentPrompt
Returns:
Resource id for the user comment input label in the crash dialog. If not provided, disables the input field.
Default:
0

resDialogEmailPrompt

public abstract int resDialogEmailPrompt
Returns:
Resource id for the user email address input label in the crash dialog. If not provided, disables the input field.
Default:
0

resDialogIcon

public abstract int resDialogIcon
Returns:
Resource id for the icon in the crash dialog. Default value is the system alert icon.
Default:
17301543

resDialogOkToast

public abstract int resDialogOkToast
Returns:
Resource id for the Toast text triggered when the user accepts to send a report in the crash dialog.
Default:
0

resDialogText

public abstract int resDialogText
Returns:
Resource id for the text in the crash dialog.
Default:
0

resDialogTitle

public abstract int resDialogTitle
Returns:
Resource id for the title in the crash dialog.
Default:
0

resNotifIcon

public abstract int resNotifIcon
Returns:
Resource id for the icon in the status bar notification. Default is the system error notification icon.
Default:
17301624

resNotifText

public abstract int resNotifText
Returns:
Resource id for the text in the status bar notification.
Default:
0

resNotifTickerText

public abstract int resNotifTickerText
Returns:
Resource id for the ticker text in the status bar notification.
Default:
0

resNotifTitle

public abstract int resNotifTitle
Returns:
Resource id for the title in the status bar notification.
Default:
0

resToastText

public abstract int resToastText
Resource id for the Toast text triggered when the application crashes if the ReportingInteractionMode.TOAST mode is used. Can also be used in ReportingInteractionMode.NOTIFICATION and ReportingInteractionMode.DIALOG modes to display a Toast message while the report is being created, before the dialog/notification appears. This allows the user to know what is happening just before the application is terminated.

Returns:
Resource id for the Toast text triggered when the application crashes.
Default:
0

sharedPreferencesName

public abstract String sharedPreferencesName
Returns:
Name of the SharedPreferences that will host ACRA settings you can make accessible to your users through a preferences screen: preference. Default is to use the application default SharedPreferences, as retrieved with PreferenceManager.getDefaultSharedPreferences(Context).
Default:
""

sharedPreferencesMode

public abstract int sharedPreferencesMode
If using a custom sharedPreferencesName(), pass here the mode that you need for the SharedPreference file creation: Context.MODE_PRIVATE, Context.MODE_WORLD_READABLE or Context.MODE_WORLD_WRITEABLE. Default is Context.MODE_PRIVATE.

Returns:
Mode to use with the SharedPreference creation.
See Also:
Context.getSharedPreferences(String, int)
Default:
0

includeDropBoxSystemTags

public abstract boolean includeDropBoxSystemTags
If enabled, DropBox events collection will include system tags:

Returns:
True if system tags are to be included as part of DropBox events.
Default:
false

additionalDropBoxTags

public abstract String[] additionalDropBoxTags
Returns:
Array of tags that you want to be fetched when collecting DropBox entries.
Default:
{}

dropboxCollectionMinutes

public abstract int dropboxCollectionMinutes
Returns:
Number of minutes to look back when collecting events from DropBoxManager.
Default:
5

logcatArguments

public abstract String[] logcatArguments

Arguments to be passed to the logcat command line. Default is { "-t", "100", "-v", "time" } for:

 logcat -t 100 -v time
 

Do not include -b arguments for buffer selection, include ReportField.EVENTSLOG and ReportField.RADIOLOG in customReportContent() to activate alternative logcat buffers reporting. They will use the same other arguments as those provided here.

See Listing of logcat Command Options.

Returns:
Array of arguments to supply if retrieving the log as part of the report.
Default:
{"-t", "100", "-v", "time"}

formUriBasicAuthLogin

public abstract String formUriBasicAuthLogin
When using the formUri() parameter to send reports to a custom server-side script, you can set here and in formUriBasicAuthPassword() the credentials for a BASIC HTTP authentication.

Returns:
Login to use when posting reports to a custom server.
Default:
"ACRA-NULL-STRING"

formUriBasicAuthPassword

public abstract String formUriBasicAuthPassword
When using the formUri() parameter to send reports to a custom server-side script, you can set here and in formUriBasicAuthLogin() the credentials for a BASIC HTTP authentication.

Returns:
Password to use when posting reports to a custom server.
Default:
"ACRA-NULL-STRING"

customReportContent

public abstract ReportField[] customReportContent

Redefines the list of ReportFields collected and sent in your reports. If you modify this list, you have to create a new Google Drive Spreadsheet & Form which will be based on these fields as column headers.

The fields order is significant. You can also use this property to modify fields order in your reports.

The default list is the following, except if you send reports by mail using mailTo().

Returns:
ReportField Array listing the fields to be included in the report.
Default:
{}

mailTo

public abstract String mailTo

Add your crash reports mailbox here if you want to send reports via email. This allows to get rid of the INTERNET permission. Reports content can be customized with customReportContent() . Default fields are:

Returns:
email address to which to send reports.
Default:
""

deleteUnapprovedReportsOnApplicationStart

public abstract boolean deleteUnapprovedReportsOnApplicationStart
Controls whether unapproved reports are deleted on application start or not. Default is true. This is a change from versions of ACRA before 3.2 as in ReportingInteractionMode.NOTIFICATION mode reports were previously kept until the user explicitly opens the Notification dialog AND choose to send or discard the report. Until then, on application restart, ACRA was issuing a new crash notification for previous reports pending for approval. This could be misunderstood by the user with a new crash, resulting in bad appreciation of the application.

Returns:
true if ACRA should delete unapproved reports on application start.
Default:
true

deleteOldUnsentReportsOnApplicationStart

public abstract boolean deleteOldUnsentReportsOnApplicationStart
This property can be used to determine whether old (out of date) reports should be sent or not. By default they are discarded.

Returns:
true if ACRA should delete any unsent reports on startup if the application has been updated since the last time the application was started.
Default:
true

connectionTimeout

public abstract int connectionTimeout
Returns:
Value in milliseconds for timeout attempting to connect to a network (default 3000ms).
Default:
3000

socketTimeout

public abstract int socketTimeout
If the request is retried due to timeout, the socketTimeout will double before retrying the request.

Returns:
Value in milliseconds for timeout receiving a response to a network request (default 5000ms).
See Also:
maxNumberOfRequestRetries()
Default:
5000

maxNumberOfRequestRetries

public abstract int maxNumberOfRequestRetries
Returns:
Maximum number of times a network request will be retried when receiving the response times out (default 3).
See Also:
socketTimeout()
Default:
3

forceCloseDialogAfterToast

public abstract boolean forceCloseDialogAfterToast
In ReportingInteractionMode.TOAST mode, set this to true if you prefer displaying the native Force Close dialog after the Toast.

Returns:
true if the Force Close dialog has to be displayed.
Default:
false

additionalSharedPreferences

public abstract String[] additionalSharedPreferences
Add here your SharedPreferences identifier Strings if you use others than your application's default. They will be added to the ReportField.SHARED_PREFERENCES field.

Returns:
String Array containing the names of the additional preferences.
Default:
{}

logcatFilterByPid

public abstract boolean logcatFilterByPid
Set this to true if you want to include only logcat lines related to your Application process.

Returns:
true if you want to filter logcat with your process id.
Default:
false

sendReportsInDevMode

public abstract boolean sendReportsInDevMode
Set this to false if you want to disable sending reports in development mode. Only signed application packages will send reports. Default value is true.

Returns:
false if reports should not be sent.
Default:
true

excludeMatchingSharedPreferencesKeys

public abstract String[] excludeMatchingSharedPreferencesKeys
Provide here regex patterns to be evaluated on each SharedPreference key to exclude KV pairs from the collected SharedPreferences. This allows you to exclude sensitive user data like passwords to be collected.

Returns:
an array of regex patterns, every matching key is not collected.
Default:
{}

excludeMatchingSettingsKeys

public abstract String[] excludeMatchingSettingsKeys
Provide here regex patterns to be evaluated on each Settings.System, Settings.Secure and Settings.Global key to exclude KV pairs from the collected SharedPreferences. This allows you to exclude sensitive data to be collected.

Returns:
an array of regex patterns, every matching key is not collected.
Default:
{}

applicationLogFile

public abstract String applicationLogFile
To use in combination with ReportField.APPLICATION_LOG to set the path/name of your application log file. If the string does not contain any path separator, the file is assumed as being in Context.getFilesDir().

Returns:
a String containing the path/name of your application log file. If the string does not containt any path separator, the file is assumed as being in Context.getFilesDir().
Default:
""

applicationLogFileLines

public abstract int applicationLogFileLines
To use in combination with ReportField.APPLICATION_LOG to set the number of latest lines of your application log file to be collected. Default value is 100.

Returns:
number of lines to collect.
Default:
100

googleFormUrlFormat

public abstract String googleFormUrlFormat

Default behavior is to send reports to an URL following the format: "https://spreadsheets.google.com/formResponse?formkey=%s&ifq" with %s replaced by the formKey() value.

If Google ever changed its URI schemes for Forms (changing the host name or parameters names for example), you would be able to override it with the new value with the present method.

Returns:
The format of the URL used to post report data in a Google Form, including a %s token which is replaced by the formKey.
Default:
"https://docs.google.com/spreadsheet/formResponse?formkey=%s&ifq"

disableSSLCertValidation

public abstract boolean disableSSLCertValidation

Set this to true if you need to post reports to your own server using an SSL connection with a self-signed certificate.

Returns:
True if SSL certificates validation has to be ignored when posting reports.
Default:
false

httpMethod

public abstract HttpSender.Method httpMethod

The HttpSender.Method to be used when posting with formKey().

Returns:
Default:
org.acra.sender.HttpSender.Method.POST

reportType

public abstract HttpSender.Type reportType
Default:
org.acra.sender.HttpSender.Type.FORM


Copyright © 2010-2013. All Rights Reserved.