org.acra
Class ACRA

java.lang.Object
  extended by org.acra.ACRA

public class ACRA
extends Object

Use this class to initialize the crash reporting feature using init(Application) as soon as possible in your Application subclass Application.onCreate() method. Configuration items must have been set by using ReportsCrashes above the declaration of your Application subclass.

Author:
Kevin Gaudin

Field Summary
static boolean DEV_LOGGING
           
static org.acra.log.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.
 
Constructor Summary
ACRA()
           
 
Method Summary
static android.content.SharedPreferences getACRASharedPreferences()
          Retrieves the SharedPreferences instance where user adjustable settings for ACRA are stored.
static ACRAConfiguration getConfig()
          Provides the current ACRA configuration.
static ErrorReporter getErrorReporter()
           
static ACRAConfiguration getNewDefaultConfig(android.app.Application app)
           
static void init(android.app.Application app)
           Initialize ACRA for a given Application.
static void setConfig(ACRAConfiguration conf)
          Sets the whole ACRA configuration.
static void setLog(org.acra.log.ACRALog log)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEV_LOGGING

public static final boolean DEV_LOGGING
See Also:
Constant Field Values

LOG_TAG

public static final String LOG_TAG

log

public static org.acra.log.ACRALog log

PREF_DISABLE_ACRA

public static final String PREF_DISABLE_ACRA
The key of the application default SharedPreference where you can put a 'true' Boolean value to disable ACRA.

See Also:
Constant Field Values

PREF_ENABLE_ACRA

public static final String PREF_ENABLE_ACRA
Alternatively, you can use this key if you prefer your users to have the checkbox ticked to enable crash reports. If both acra.disable and acra.enable are set, the value of acra.disable takes over the other.

See Also:
Constant Field Values

PREF_ENABLE_SYSTEM_LOGS

public static final String PREF_ENABLE_SYSTEM_LOGS
The key of the SharedPreference allowing the user to disable sending content of logcat/dropbox. System logs collection is also dependent of the READ_LOGS permission.

See Also:
Constant Field Values

PREF_ENABLE_DEVICE_ID

public static final String PREF_ENABLE_DEVICE_ID
The key of the SharedPreference allowing the user to disable sending his device id. Device ID collection is also dependent of the READ_PHONE_STATE permission.

See Also:
Constant Field Values

PREF_USER_EMAIL_ADDRESS

public static final String PREF_USER_EMAIL_ADDRESS
The key of the SharedPreference allowing the user to always include his email address.

See Also:
Constant Field Values

PREF_ALWAYS_ACCEPT

public static final String PREF_ALWAYS_ACCEPT
The key of the SharedPreference allowing the user to automatically accept sending reports.

See Also:
Constant Field Values

PREF_LAST_VERSION_NR

public static final String PREF_LAST_VERSION_NR
The version number of the application the last time ACRA was started. This is used to determine whether unsent reports should be discarded because they are old and out of date.

See Also:
Constant Field Values
Constructor Detail

ACRA

public ACRA()
Method Detail

init

public static void init(android.app.Application app)

Initialize ACRA for a given Application. The call to this method should be placed as soon as possible in the Application.onCreate() method.

Parameters:
app - Your Application class.
Throws:
IllegalStateException - if it is called more than once.

getErrorReporter

public static ErrorReporter getErrorReporter()
Returns:
the current instance of ErrorReporter.
Throws:
IllegalStateException - if init(android.app.Application) has not yet been called.

getACRASharedPreferences

public static android.content.SharedPreferences getACRASharedPreferences()
Retrieves the SharedPreferences instance where user adjustable settings for ACRA are stored. Default are the Application default SharedPreferences, but you can provide another SharedPreferences name with ReportsCrashes.sharedPreferencesName().

Returns:
The Shared Preferences where ACRA will retrieve its user adjustable setting.

getConfig

public static ACRAConfiguration getConfig()
Provides the current ACRA configuration.

Returns:
Current ACRA ReportsCrashes configuration instance.

setConfig

public static void setConfig(ACRAConfiguration conf)
Sets the whole ACRA configuration.

Parameters:
conf - ACRAConfiguration to use as a proxy for config info.

getNewDefaultConfig

public static ACRAConfiguration getNewDefaultConfig(android.app.Application app)
Returns:
new ACRAConfiguration instance with values initialized from the ReportsCrashes annotation.

setLog

public static void setLog(org.acra.log.ACRALog log)


Copyright © 2010-2013. All Rights Reserved.