@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
@Inherited
public @interface ReportsCrashes
ACRA.init(android.app.Application)
method.Modifier and Type | Optional Element and Description |
---|---|
java.lang.String[] |
additionalDropBoxTags |
java.lang.String[] |
additionalSharedPreferences
Add here your
SharedPreferences identifier Strings if you use
others than your application's default. |
boolean |
alsoReportToAndroidFramework
Set this to true if you prefer displaying the native force close dialog after the ACRA is done.
|
java.lang.String |
applicationLogFile
To use in combination with
ReportField.APPLICATION_LOG to set the
path/name of your application log file. |
Directory |
applicationLogFileDir
To use in combination with
ReportField.APPLICATION_LOG to set the root
for the path provided in applicationLogFile() |
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. |
java.lang.Class<? extends AttachmentUriProvider> |
attachmentUriProvider
Allows attachmentUri configuration at runtime instead of compile time.
|
java.lang.String[] |
attachmentUris
Allows to attach files to crash reports.
|
java.lang.Class |
buildConfigClass
The default value will be a BuildConfig class residing in the same package as the Application class.
|
java.lang.String |
certificatePath |
java.lang.String |
certificateType |
int |
connectionTimeout |
ReportField[] |
customReportContent
Redefines the list of
ReportField s 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.
|
int |
dropboxCollectionMinutes |
java.lang.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.
|
java.lang.String[] |
excludeMatchingSharedPreferencesKeys
Provide here regex patterns to be evaluated on each SharedPreference key
to exclude KV pairs from the collected SharedPreferences.
|
java.lang.String |
formUri
The Uri of your own server-side script that will receive reports.
|
java.lang.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. |
java.lang.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. |
HttpSender.Method |
httpMethod
The
HttpSender.Method to be used when posting with formUri() . |
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
|
java.lang.Class<? extends KeyStoreFactory> |
keyStoreFactoryClass |
java.lang.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.
|
java.lang.String |
mailTo
Add your crash reports mailbox here if you want to send reports via
email.
|
ReportingInteractionMode |
mode
The interaction mode you want to implement.
|
boolean |
nonBlockingReadForLogcat
Set this to true if you want to read logcat lines in a non blocking way for your
thread.
|
boolean |
reportAsFile |
java.lang.Class<? extends BaseCrashReportDialog> |
reportDialogClass |
java.lang.Class<? extends ReportPrimer> |
reportPrimerClass |
java.lang.Class<? extends ReportSenderFactory>[] |
reportSenderFactoryClasses
The default
ReportSenderFactory creates an EmailIntentSender
if the 'mailTo' parameter is defined or an HttpSender if the 'formUri' parameter
is defined (and internet permission has been granted. |
HttpSender.Type |
reportType
The
HttpSender.Type to be used when posting with formUri() . |
int |
resCertificate |
int |
resDialogCommentPrompt |
int |
resDialogEmailPrompt |
int |
resDialogIcon |
int |
resDialogNegativeButtonText |
int |
resDialogOkToast |
int |
resDialogPositiveButtonText |
int |
resDialogText |
int |
resDialogTheme |
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. |
java.lang.Class<? extends RetryPolicy> |
retryPolicyClass |
boolean |
sendReportsAtShutdown
Deprecated.
since 4.8.3 no replacement. Now that we are using the SenderService in a separate process we always send at shutdown.
|
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 . |
java.lang.String |
sharedPreferencesName |
int |
socketTimeout
If the request is retried due to timeout, the socketTimeout will double
before retrying the request.
|
boolean |
stopServicesOnCrash |
@NonNull public abstract java.lang.String formUri
@NonNull 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:
ReportingInteractionMode.TOAST
requires
resToastText()
to be provided to define the text that you want
to be displayed to the user when a report is being sent.ReportingInteractionMode.NOTIFICATION
requires
resNotifTickerText()
, resNotifTitle()
,
resNotifText()
, resDialogText()
.ReportingInteractionMode.DIALOG
requires
resDialogText()
.
Default is ReportingInteractionMode.SILENT
@StringRes public abstract int resDialogPositiveButtonText
@StringRes public abstract int resDialogNegativeButtonText
@StringRes public abstract int resDialogCommentPrompt
@StringRes public abstract int resDialogEmailPrompt
@DrawableRes public abstract int resDialogIcon
@StringRes public abstract int resDialogOkToast
@StringRes public abstract int resDialogText
@StringRes public abstract int resDialogTitle
@StyleRes public abstract int resDialogTheme
@DrawableRes public abstract int resNotifIcon
@StringRes public abstract int resNotifText
@StringRes public abstract int resNotifTickerText
@StringRes public abstract int resNotifTitle
@StringRes public abstract int resToastText
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.@NonNull public abstract java.lang.String sharedPreferencesName
ACRA.PREF_DISABLE_ACRA
or ACRA.PREF_ENABLE_ACRA
ACRA.PREF_ALWAYS_ACCEPT
ACRA.PREF_ENABLE_DEVICE_ID
ACRA.PREF_ENABLE_SYSTEM_LOGS
PreferenceManager.getDefaultSharedPreferences(android.content.Context)
.public abstract int sharedPreferencesMode
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
.Context.getSharedPreferences(String, int)
public abstract boolean includeDropBoxSystemTags
@NonNull public abstract java.lang.String[] additionalDropBoxTags
public abstract int dropboxCollectionMinutes
@NonNull public abstract java.lang.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.
@NonNull public abstract java.lang.String formUriBasicAuthLogin
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.@NonNull public abstract java.lang.String formUriBasicAuthPassword
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.@NonNull public abstract ReportField[] customReportContent
Redefines the list of ReportField
s collected and sent in your
reports.
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()
.
ReportField.REPORT_ID
ReportField.APP_VERSION_CODE
ReportField.APP_VERSION_NAME
ReportField.PACKAGE_NAME
ReportField.FILE_PATH
ReportField.PHONE_MODEL
ReportField.BRAND
ReportField.PRODUCT
ReportField.ANDROID_VERSION
ReportField.BUILD
ReportField.TOTAL_MEM_SIZE
ReportField.AVAILABLE_MEM_SIZE
ReportField.CUSTOM_DATA
ReportField.IS_SILENT
ReportField.STACK_TRACE
ReportField.INITIAL_CONFIGURATION
ReportField.CRASH_CONFIGURATION
ReportField.DISPLAY
ReportField.USER_COMMENT
ReportField.USER_EMAIL
ReportField.USER_APP_START_DATE
ReportField.USER_CRASH_DATE
ReportField.DUMPSYS_MEMINFO
ReportField.LOGCAT
ReportField.INSTALLATION_ID
ReportField.DEVICE_FEATURES
ReportField.ENVIRONMENT
ReportField.SHARED_PREFERENCES
ReportField.SETTINGS_SYSTEM
ReportField.SETTINGS_SECURE
ReportField.SETTINGS_GLOBAL
@NonNull public abstract java.lang.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:
public abstract boolean deleteUnapprovedReportsOnApplicationStart
Silent and Toast reports are automatically approved. Dialog and Notification reports required explicit approval by the user before they are sent.
On application restart the user is prompted with approval for any unsent reports. So you generally don't want to accumulate unapproved reports, otherwise you will prompt them multiple times.
If this is set to true then all unapproved reports bar one will be deleted on application start. The last report is always retained because that is the report that probably just happened.
If set to false then on restart the user will be prompted with approval for each unapproved report.
public abstract boolean deleteOldUnsentReportsOnApplicationStart
public abstract int connectionTimeout
public abstract int socketTimeout
public abstract boolean alsoReportToAndroidFramework
ReportingInteractionMode.DIALOG
for notification.@NonNull public abstract java.lang.String[] additionalSharedPreferences
SharedPreferences
identifier Strings if you use
others than your application's default. They will be added to the
ReportField.SHARED_PREFERENCES
field.public abstract boolean logcatFilterByPid
public abstract boolean nonBlockingReadForLogcat
public abstract boolean sendReportsInDevMode
@Deprecated public abstract boolean sendReportsAtShutdown
@NonNull public abstract java.lang.String[] excludeMatchingSharedPreferencesKeys
@NonNull public abstract java.lang.String[] excludeMatchingSettingsKeys
@NonNull public abstract java.lang.Class buildConfigClass
@NonNull public abstract java.lang.Class<? extends ReportSenderFactory>[] reportSenderFactoryClasses
ReportSenderFactory
creates an EmailIntentSender
if the 'mailTo' parameter is defined or an HttpSender
if the 'formUri' parameter
is defined (and internet permission has been granted.ReportSenderFactory
with which to construct the
ReportSender
s that will send the crash reports.@NonNull public abstract java.lang.String applicationLogFile
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()
.Context.getFilesDir()
.public abstract int applicationLogFileLines
ReportField.APPLICATION_LOG
to set the
number of latest lines of your application log file to be collected.
Default value is 100.@NonNull public abstract Directory applicationLogFileDir
ReportField.APPLICATION_LOG
to set the root
for the path provided in applicationLogFile()
@NonNull public abstract java.lang.Class<? extends BaseCrashReportDialog> reportDialogClass
@NonNull public abstract java.lang.Class<? extends ReportPrimer> reportPrimerClass
@NonNull public abstract HttpSender.Method httpMethod
The HttpSender.Method
to be used when posting with formUri()
.
@NonNull public abstract HttpSender.Type reportType
The HttpSender.Type
to be used when posting with formUri()
.
@NonNull public abstract java.lang.Class<? extends KeyStoreFactory> keyStoreFactoryClass
@NonNull public abstract java.lang.String certificatePath
@RawRes public abstract int resCertificate
@NonNull public abstract java.lang.String certificateType
certificatePath()
or resCertificate()
@NonNull public abstract java.lang.Class<? extends RetryPolicy> retryPolicyClass
public abstract boolean stopServicesOnCrash
@NonNull public abstract java.lang.String[] attachmentUris
ACRA contains a file provider under the following Uri:
content://[applicationId].acra/[Directory]/[Path]
where [applicationId] is your application package name,
[Directory] is one of the enum constants in Directory
in lower case
and [Path] is the relative path to the file in that directory
e.g. content://org.acra.provider/files/thisIsATest.txt
@NonNull public abstract java.lang.Class<? extends AttachmentUriProvider> attachmentUriProvider