Package fi.bitwards.service
Class BitwardsService.Debug
java.lang.Object
fi.bitwards.service.BitwardsService.Debug
- Enclosing class:
BitwardsService
BitwardsService.Debug class is used to setup error reporting.
Uses ACRA for error report handling.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final StringgetErrorString(int errorCode) Get textual representation (error string) of the error codestatic final voidinitializeACRA(android.content.Context context, Class buildConfigClazz) Setup application crash reporting if needed.final booleanCheck if ACRA has been initialized.*static voidSend an error report to Bitwards if error reporting has been enabled.static voidsendErrorReport(String message) Send an error report to Bitwards if error reporting has been enabled.static voidSend an error report for an exception to Bitwards if error reporting has been enabled.static voidsendErrorReport(Properties properties) Send an error report with additional properties to Bitwards if error reporting has been enabled.static voidsetErrorReporting(boolean enable) Set whether you want errors that occurred in SDK operation to be sent to Bitwards.
-
Constructor Details
-
Debug
public Debug()
-
-
Method Details
-
initializeACRA
Setup application crash reporting if needed. Crash report will be sent to Bitwards. Uses ACRA to the crash reporting. Note that it is not required to be setup and application developers may use their own crash reporting tool.- Parameters:
context- the contextbuildConfigClazz- BuildConfig.class
-
setErrorReporting
public static void setErrorReporting(boolean enable) Set whether you want errors that occurred in SDK operation to be sent to Bitwards. By default it is turned off. Note that these reports may contain Android logs. In addition, the Bitwards error reporting URI needs to be setup with your project, please contact Bitwards to obtain instructions how to do it.- Parameters:
enable- true if you want error reporting to be enabled
-
sendErrorReport
public static void sendErrorReport()Send an error report to Bitwards if error reporting has been enabled. To enable error reporting, usesetErrorReporting(boolean). -
sendErrorReport
Send an error report to Bitwards if error reporting has been enabled. To enable error reporting, usesetErrorReporting(boolean).- Parameters:
message- the message
-
sendErrorReport
Send an error report with additional properties to Bitwards if error reporting has been enabled. To enable error reporting, usesetErrorReporting(boolean).- Parameters:
properties- the properties to be added to the error report.
-
sendErrorReport
Send an error report for an exception to Bitwards if error reporting has been enabled. To enable error reporting, usesetErrorReporting(boolean).- Parameters:
t- the throwable to send the error report on
-
isInitialized
public final boolean isInitialized()Check if ACRA has been initialized.*- Returns:
- true if ACRA has been initialized, false if not.
-
getErrorString
Get textual representation (error string) of the error code- Parameters:
errorCode- the error code- Returns:
- the error string
-