public final class ACRA extends Object
init(Application)
as soon as possible in your Application
subclass Application.onCreate()
method. Configuration items must have
been set by using AcraCore
above the declaration of your
Application
subclass.Modifier and Type | Field and Description |
---|---|
static boolean |
DEV_LOGGING |
static ACRALog |
log |
static String |
LOG_TAG |
static String |
PREF_ALWAYS_ACCEPT
The key of the SharedPreference allowing the user to automatically accept
sending reports.
|
static String |
PREF_DISABLE_ACRA
The key of the application default SharedPreference where you can put a
'true' Boolean value to disable ACRA.
|
static String |
PREF_ENABLE_ACRA
Alternatively, you can use this key if you prefer your users to have the
checkbox ticked to enable crash reports.
|
static String |
PREF_ENABLE_DEVICE_ID
The key of the SharedPreference allowing the user to disable sending his
device id.
|
static String |
PREF_ENABLE_SYSTEM_LOGS
The key of the SharedPreference allowing the user to disable sending
content of logcat/dropbox.
|
static String |
PREF_LAST_VERSION_NR
The version number of the application the last time ACRA was started.
|
static String |
PREF_USER_EMAIL_ADDRESS
The key of the SharedPreference allowing the user to always include his
email address.
|
Modifier and Type | Method and Description |
---|---|
static ErrorReporter |
getErrorReporter() |
static void |
init(Application app)
Initialize ACRA for a given Application.
|
static void |
init(Application app,
CoreConfiguration config)
Initialize ACRA for a given Application.
|
static void |
init(Application app,
CoreConfiguration config,
boolean checkReportsOnApplicationStart)
Initialize ACRA for a given Application.
|
static void |
init(Application app,
CoreConfigurationBuilder builder)
Initialize ACRA for a given Application.
|
static void |
init(Application app,
CoreConfigurationBuilder builder,
boolean checkReportsOnApplicationStart)
Initialize ACRA for a given Application.
|
static boolean |
isACRASenderServiceProcess() |
static boolean |
isInitialised() |
static void |
setLog(ACRALog log) |
public static boolean DEV_LOGGING
public static final String LOG_TAG
public static final String PREF_DISABLE_ACRA
public static final String PREF_ENABLE_ACRA
public static final String PREF_ENABLE_SYSTEM_LOGS
public static final String PREF_ENABLE_DEVICE_ID
public static final String PREF_USER_EMAIL_ADDRESS
public static final String PREF_ALWAYS_ACCEPT
public static final String PREF_LAST_VERSION_NR
public static void init(@NonNull Application app)
Initialize ACRA for a given Application.
The call to this method should be placed as soon as possible in the ContextWrapper.attachBaseContext(Context)
method.
Uses the configuration as configured with the @ReportCrashes annotation. Sends any unsent reports.
app
- Your Application class.IllegalStateException
- if it is called more than once.public static void init(@NonNull Application app, @NonNull CoreConfigurationBuilder builder)
Initialize ACRA for a given Application.
The call to this method should be placed as soon as possible in the ContextWrapper.attachBaseContext(Context)
method.
Uses the configuration as configured with the @ReportCrashes annotation. Sends any unsent reports.
app
- Your Application class.builder
- ConfigurationBuilder to manually set up ACRA configuration.public static void init(@NonNull Application app, @NonNull CoreConfigurationBuilder builder, boolean checkReportsOnApplicationStart)
Initialize ACRA for a given Application.
The call to this method should be placed as soon as possible in the ContextWrapper.attachBaseContext(Context)
method.
app
- Your Application class.builder
- ConfigurationBuilder to manually set up ACRA configuration.checkReportsOnApplicationStart
- Whether to invoke ErrorReporter.checkReportsOnApplicationStart().public static void init(@NonNull Application app, @NonNull CoreConfiguration config)
Initialize ACRA for a given Application.
The call to this method should be placed as soon as possible in the ContextWrapper.attachBaseContext(Context)
method.
Sends any unsent reports.
app
- Your Application class.config
- CoreConfiguration to manually set up ACRA configuration.IllegalStateException
- if it is called more than once.public static void init(@NonNull Application app, @NonNull CoreConfiguration config, boolean checkReportsOnApplicationStart)
Initialize ACRA for a given Application. The call to this method should
be placed as soon as possible in the ContextWrapper.attachBaseContext(Context)
method.
app
- Your Application class.config
- CoreConfiguration to manually set up ACRA configuration.checkReportsOnApplicationStart
- Whether to invoke ErrorReporter.checkReportsOnApplicationStart().IllegalStateException
- if it is called more than once.public static boolean isInitialised()
public static boolean isACRASenderServiceProcess()
@NonNull public static ErrorReporter getErrorReporter()
IllegalStateException
- if init(android.app.Application)
has not yet been called.