org.acra
Class ACRAConfiguration

java.lang.Object
  extended by org.acra.ACRAConfiguration
All Implemented Interfaces:
Annotation, ReportsCrashes

public class ACRAConfiguration
extends Object
implements ReportsCrashes

This class is to be used if you need to apply dynamic settings. This is needed for example when using ACRA in an Android Library Project since ADT v14 where resource ids are not final anymore and can't be passed as annotation parameters values.


Constructor Summary
ACRAConfiguration(ReportsCrashes defaults)
           
 
Method Summary
 String[] additionalDropBoxTags()
           
 String[] additionalSharedPreferences()
           
 Class<? extends Annotation> annotationType()
           
 String applicationLogFile()
           
 int applicationLogFileLines()
           
 int connectionTimeout()
           
 ReportField[] customReportContent()
           
 boolean deleteOldUnsentReportsOnApplicationStart()
           
 boolean deleteUnapprovedReportsOnApplicationStart()
           
 boolean disableSSLCertValidation()
           
 int dropboxCollectionMinutes()
           
 String[] excludeMatchingSettingsKeys()
           
 String[] excludeMatchingSharedPreferencesKeys()
           
 boolean forceCloseDialogAfterToast()
           
 String formKey()
           
 String formUri()
           
 String formUriBasicAuthLogin()
           
 String formUriBasicAuthPassword()
           
 Map<String,String> getHttpHeaders()
          Retrieve HTTP headers defined by the application developer.
 String googleFormUrlFormat()
           
 HttpSender.Method httpMethod()
           
 boolean includeDropBoxSystemTags()
           
static boolean isNull(String aString)
           
 String[] logcatArguments()
           
 boolean logcatFilterByPid()
           
 String mailTo()
           
 int maxNumberOfRequestRetries()
           
 ReportingInteractionMode mode()
           
 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()
           
 boolean sendReportsInDevMode()
           
 void setAdditionalDropboxTags(String[] additionalDropboxTags)
           
 void setAdditionalSharedPreferences(String[] additionalSharedPreferences)
           
 void setApplicationLogFile(String applicationLogFile)
           
 void setApplicationLogFileLines(int applicationLogFileLines)
           
 void setConnectionTimeout(Integer connectionTimeout)
           
 void setCustomReportContent(ReportField[] customReportContent)
           
 void setDeleteOldUnsentReportsOnApplicationStart(Boolean deleteOldUnsetReportsOnApplicationStart)
           
 void setDeleteUnapprovedReportsOnApplicationStart(Boolean deleteUnapprovedReportsOnApplicationStart)
           
 void setDisableSSLCertValidation(boolean disableSSLCertValidation)
           
 void setDropboxCollectionMinutes(Integer dropboxCollectionMinutes)
           
 void setExcludeMatchingSettingsKeys(String[] excludeMatchingSettingsKeys)
           
 void setExcludeMatchingSharedPreferencesKeys(String[] excludeMatchingSharedPreferencesKeys)
           
 void setForceCloseDialogAfterToast(Boolean forceCloseDialogAfterToast)
           
 void setFormKey(String formKey)
          Modify the formKey of the Google Docs form receiving reports.
 void setFormUri(String formUri)
          Modify the formUri of your backend server receiving reports.
 void setFormUriBasicAuthLogin(String formUriBasicAuthLogin)
           
 void setFormUriBasicAuthPassword(String formUriBasicAuthPassword)
           
 void setHttpHeaders(Map<String,String> headers)
          Set custom HTTP headers to be sent by the provided HttpSender.
 void setHttpMethod(HttpSender.Method httpMethod)
           
 void setIncludeDropboxSystemTags(Boolean includeDropboxSystemTags)
           
 void setLogcatArguments(String[] logcatArguments)
           
 void setLogcatFilterByPid(Boolean filterByPid)
           
 void setMailTo(String mailTo)
          Modify the mailTo of the mail account receiving reports.
 void setMaxNumberOfRequestRetries(Integer maxNumberOfRequestRetries)
           
 void setMode(ReportingInteractionMode mode)
          Change the current ReportingInteractionMode.
 void setReportType(HttpSender.Type type)
           
 void setResDialogCommentPrompt(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resDialogCommentPrompt() comes from an Android Library Project.
 void setResDialogEmailPrompt(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resDialogEmailPrompt() comes from an Android Library Project.
 void setResDialogIcon(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resDialogIcon() comes from an Android Library Project.
 void setResDialogOkToast(int resId)
          Use this method BEFORE if the id you wanted to give to ReportsCrashes.resDialogOkToast() comes from an Android Library Project.
 void setResDialogText(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resDialogText() comes from an Android Library Project.
 void setResDialogTitle(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resDialogTitle() comes from an Android Library Project.
 void setResNotifIcon(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resNotifIcon() comes from an Android Library Project.
 void setResNotifText(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resNotifText() comes from an Android Library Project.
 void setResNotifTickerText(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resNotifTickerText() comes from an Android Library Project.
 void setResNotifTitle(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resNotifTitle() comes from an Android Library Project.
 void setResToastText(int resId)
          Use this method if the id you wanted to give to ReportsCrashes.resToastText() comes from an Android Library Project.
 void setSendReportsInDevMode(Boolean sendReportsInDevMode)
           
 void setSharedPreferenceMode(Integer sharedPreferenceMode)
           
 void setSharedPreferenceName(String sharedPreferenceName)
           
 void setSocketTimeout(Integer socketTimeout)
           
 int sharedPreferencesMode()
           
 String sharedPreferencesName()
           
 int socketTimeout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.annotation.Annotation
equals, hashCode, toString
 

Constructor Detail

ACRAConfiguration

public ACRAConfiguration(ReportsCrashes defaults)
Parameters:
defaults -
Method Detail

setHttpHeaders

public void setHttpHeaders(Map<String,String> headers)
Set custom HTTP headers to be sent by the provided HttpSender. This should be used also by third party senders.

Parameters:
headers - A map associating HTTP header names to their values.

getHttpHeaders

public Map<String,String> getHttpHeaders()
Retrieve HTTP headers defined by the application developer. These should be added to requests sent by any third-party sender (over HTTP of course).

Returns:
A map associating http header names to their values.

setAdditionalDropboxTags

public void setAdditionalDropboxTags(String[] additionalDropboxTags)
Parameters:
additionalDropboxTags - the additionalDropboxTags to set

setAdditionalSharedPreferences

public void setAdditionalSharedPreferences(String[] additionalSharedPreferences)
Parameters:
additionalSharedPreferences - the additionalSharedPreferences to set

setConnectionTimeout

public void setConnectionTimeout(Integer connectionTimeout)
Parameters:
connectionTimeout - the connectionTimeout to set

setCustomReportContent

public void setCustomReportContent(ReportField[] customReportContent)
Parameters:
customReportContent - the customReportContent to set

setDeleteUnapprovedReportsOnApplicationStart

public void setDeleteUnapprovedReportsOnApplicationStart(Boolean deleteUnapprovedReportsOnApplicationStart)
Parameters:
deleteUnapprovedReportsOnApplicationStart - the deleteUnapprovedReportsOnApplicationStart to set

setDeleteOldUnsentReportsOnApplicationStart

public void setDeleteOldUnsentReportsOnApplicationStart(Boolean deleteOldUnsetReportsOnApplicationStart)
Parameters:
deleteOldUnsetReportsOnApplicationStart -

setDropboxCollectionMinutes

public void setDropboxCollectionMinutes(Integer dropboxCollectionMinutes)
Parameters:
dropboxCollectionMinutes - the dropboxCollectionMinutes to set

setForceCloseDialogAfterToast

public void setForceCloseDialogAfterToast(Boolean forceCloseDialogAfterToast)
Parameters:
forceCloseDialogAfterToast - the forceCloseDialogAfterToast to set

setFormKey

public void setFormKey(String formKey)
Modify the formKey of the Google Docs form receiving reports. You need to call ErrorReporter.setDefaultReportSenders() after modifying this value if you were not using a formKey before (a mailTo or formUri instead).

Parameters:
formKey - the formKey to set

setFormUri

public void setFormUri(String formUri)
Modify the formUri of your backend server receiving reports. You need to call ErrorReporter.setDefaultReportSenders() after modifying this value if you were not using a formUri before (a mailTo or formKey instead).

Parameters:
formUri - the formUri to set

setFormUriBasicAuthLogin

public void setFormUriBasicAuthLogin(String formUriBasicAuthLogin)
Parameters:
formUriBasicAuthLogin - the formUriBasicAuthLogin to set

setFormUriBasicAuthPassword

public void setFormUriBasicAuthPassword(String formUriBasicAuthPassword)
Parameters:
formUriBasicAuthPassword - the formUriBasicAuthPassword to set

setIncludeDropboxSystemTags

public void setIncludeDropboxSystemTags(Boolean includeDropboxSystemTags)
Parameters:
includeDropboxSystemTags - the includeDropboxSystemTags to set

setLogcatArguments

public void setLogcatArguments(String[] logcatArguments)
Parameters:
logcatArguments - the logcatArguments to set

setMailTo

public void setMailTo(String mailTo)
Modify the mailTo of the mail account receiving reports. You need to call ErrorReporter.setDefaultReportSenders() after modifying this value if you were not using a formKey before (a formKey or formUri instead).

Parameters:
mailTo - the mailTo to set

setMaxNumberOfRequestRetries

public void setMaxNumberOfRequestRetries(Integer maxNumberOfRequestRetries)
Parameters:
maxNumberOfRequestRetries - the maxNumberOfRequestRetries to set

setMode

public void setMode(ReportingInteractionMode mode)
             throws ACRAConfigurationException
Change the current ReportingInteractionMode. You must set required configuration items first.

Parameters:
mode - the new mode to set.
Throws:
ACRAConfigurationException - if a configuration item is missing for this mode.

setResDialogCommentPrompt

public void setResDialogCommentPrompt(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resDialogCommentPrompt() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogCommentPrompt()

setResDialogEmailPrompt

public void setResDialogEmailPrompt(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resDialogEmailPrompt() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogEmailPrompt()

setResDialogIcon

public void setResDialogIcon(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resDialogIcon() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogIcon()

setResDialogOkToast

public void setResDialogOkToast(int resId)
Use this method BEFORE if the id you wanted to give to ReportsCrashes.resDialogOkToast() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogOkToast()

setResDialogText

public void setResDialogText(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resDialogText() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogText()

setResDialogTitle

public void setResDialogTitle(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resDialogTitle() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resDialogTitle()

setResNotifIcon

public void setResNotifIcon(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resNotifIcon() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resNotifIcon()

setResNotifText

public void setResNotifText(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resNotifText() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resNotifText()

setResNotifTickerText

public void setResNotifTickerText(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resNotifTickerText() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resNotifTickerText()

setResNotifTitle

public void setResNotifTitle(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resNotifTitle() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resNotifTitle()

setResToastText

public void setResToastText(int resId)
Use this method if the id you wanted to give to ReportsCrashes.resToastText() comes from an Android Library Project.

Parameters:
resId - The resource id, see ReportsCrashes.resToastText()

setSharedPreferenceMode

public void setSharedPreferenceMode(Integer sharedPreferenceMode)
Parameters:
sharedPreferenceMode - the sharedPreferenceMode to set

setSharedPreferenceName

public void setSharedPreferenceName(String sharedPreferenceName)
Parameters:
sharedPreferenceName - the sharedPreferenceName to set

setSocketTimeout

public void setSocketTimeout(Integer socketTimeout)
Parameters:
socketTimeout - the socketTimeout to set

setLogcatFilterByPid

public void setLogcatFilterByPid(Boolean filterByPid)
Parameters:
filterByPid - true if you want to collect only logcat lines related to your application process.

setSendReportsInDevMode

public void setSendReportsInDevMode(Boolean sendReportsInDevMode)
Parameters:
sendReportsInDevMode - false if you want to disable sending reports in development mode. Reports will be sent only on signed applications.

setExcludeMatchingSharedPreferencesKeys

public void setExcludeMatchingSharedPreferencesKeys(String[] excludeMatchingSharedPreferencesKeys)
Parameters:
excludeMatchingSharedPreferencesKeys - an array of Strings containing regexp defining SharedPreferences keys that should be excluded from the data collection.

setExcludeMatchingSettingsKeys

public void setExcludeMatchingSettingsKeys(String[] excludeMatchingSettingsKeys)
Parameters:
excludeMatchingSettingsKeys - an array of Strings containing regexp defining Settings.System, Settings.Secure and Settings.Global keys that should be excluded from the data collection.

setApplicationLogFile

public void setApplicationLogFile(String applicationLogFile)
Parameters:
applicationLogFile - The path and file name of your application log file, to be used with ReportField.APPLICATION_LOG.

setApplicationLogFileLines

public void setApplicationLogFileLines(int applicationLogFileLines)
Parameters:
applicationLogFileLines - The number of lines of your application log to be collected, to be used with ReportField.APPLICATION_LOG and ReportsCrashes.applicationLogFile().

setDisableSSLCertValidation

public void setDisableSSLCertValidation(boolean disableSSLCertValidation)
Parameters:
disableSSLCertValidation - Set this to true if you need to send reports to a server over SSL using a self-signed certificate.

setHttpMethod

public void setHttpMethod(HttpSender.Method httpMethod)
Parameters:
httpMethod - The method to be used to send data to the server.

setReportType

public void setReportType(HttpSender.Type type)
Parameters:
type - The type of content encoding to be used to send data to the server.

additionalDropBoxTags

public String[] additionalDropBoxTags()

additionalSharedPreferences

public String[] additionalSharedPreferences()

annotationType

public Class<? extends Annotation> annotationType()
Specified by:
annotationType in interface Annotation

connectionTimeout

public int connectionTimeout()

customReportContent

public ReportField[] customReportContent()

deleteUnapprovedReportsOnApplicationStart

public boolean deleteUnapprovedReportsOnApplicationStart()

deleteOldUnsentReportsOnApplicationStart

public boolean deleteOldUnsentReportsOnApplicationStart()

dropboxCollectionMinutes

public int dropboxCollectionMinutes()

forceCloseDialogAfterToast

public boolean forceCloseDialogAfterToast()

formKey

public String formKey()

formUri

public String formUri()

formUriBasicAuthLogin

public String formUriBasicAuthLogin()

formUriBasicAuthPassword

public String formUriBasicAuthPassword()

includeDropBoxSystemTags

public boolean includeDropBoxSystemTags()

logcatArguments

public String[] logcatArguments()

mailTo

public String mailTo()

maxNumberOfRequestRetries

public int maxNumberOfRequestRetries()

mode

public ReportingInteractionMode mode()

resDialogCommentPrompt

public int resDialogCommentPrompt()

resDialogEmailPrompt

public int resDialogEmailPrompt()

resDialogIcon

public int resDialogIcon()

resDialogOkToast

public int resDialogOkToast()

resDialogText

public int resDialogText()

resDialogTitle

public int resDialogTitle()

resNotifIcon

public int resNotifIcon()

resNotifText

public int resNotifText()

resNotifTickerText

public int resNotifTickerText()

resNotifTitle

public int resNotifTitle()

resToastText

public int resToastText()

sharedPreferencesMode

public int sharedPreferencesMode()

sharedPreferencesName

public String sharedPreferencesName()

socketTimeout

public int socketTimeout()

logcatFilterByPid

public boolean logcatFilterByPid()

sendReportsInDevMode

public boolean sendReportsInDevMode()

excludeMatchingSharedPreferencesKeys

public String[] excludeMatchingSharedPreferencesKeys()

excludeMatchingSettingsKeys

public String[] excludeMatchingSettingsKeys()

applicationLogFile

public String applicationLogFile()

applicationLogFileLines

public int applicationLogFileLines()

googleFormUrlFormat

public String googleFormUrlFormat()

disableSSLCertValidation

public boolean disableSSLCertValidation()

httpMethod

public HttpSender.Method httpMethod()

reportType

public HttpSender.Type reportType()

isNull

public static boolean isNull(String aString)


Copyright © 2010-2013. All Rights Reserved.