-
- All Implemented Interfaces:
-
backtraceio.library.interfaces.Client
public class BacktraceBase implements Client
Base Backtrace Android client
-
-
Constructor Summary
Constructors Constructor Description BacktraceBase(Context context, BacktraceCredentials credentials)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, List<String> attachments)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Map<String, Object> attributes)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Map<String, Object> attributes, List<String> attachments)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, List<String> attachments)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes, List<String> attachments)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Database database)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Database database, List<String> attachments)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes)Initialize new client instance with BacktraceCredentials BacktraceBase(Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes, List<String> attachments)Initialize new client instance with BacktraceCredentials
-
Method Summary
Modifier and Type Method Description Map<String, Object>getAttributes()Get custom attributes List<String>getAttachments()Get the set of file attachment paths that will be included with crash reportsand submissions. native voidcrash()voidenableNativeIntegration()Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature). voidenableNativeIntegration(boolean enableClientSideUnwinding)Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature). voidenableNativeIntegration(boolean enableClientSideUnwinding, UnwindingMode unwindingMode)Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature). voiddisableNativeIntegration()voidenableProguard()Inform Backtrace API that we are using Proguard symbolication voidaddAttachment(String attachmentPath)Add a file attachment path to be included with crash reports and submissions. voidaddAttribute(String key, Object value)Adds a new attribute to Backtrace Client. voidaddAttribute(Map<String, Object> attributes)Adds new attributes to Backtrace Client. voidsetOnBeforeSendEventListener(OnBeforeSendEventListener eventListener)Set event executed before sending data to Backtrace API voidsetOnServerErrorEventListener(OnServerErrorEventListener eventListener)Set an event executed when received bad request, unauthorize request or otherinformation from server voidsetOnRequestHandler(RequestHandler requestHandler)Custom request handler for sending Backtrace reports to server booleanenableBreadcrumbs(Context context)Enable logging of breadcrumbs and submission with crash reports booleanenableBreadcrumbs(Context context, int maxBreadcrumbLogSizeBytes)Enable logging of breadcrumbs and submission with crash reports booleanenableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable)Enable logging of breadcrumbs and submission with crash reports booleanenableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable, int maxBreadcrumbLogSizeBytes)Enable logging of breadcrumbs and submission with crash reports booleanclearBreadcrumbs()Clear breadcrumb logs booleanaddBreadcrumb(String message)Add a breadcrumb of type "Manual" and level "Info" with the provided messagestring booleanaddBreadcrumb(String message, BacktraceBreadcrumbLevel level)Add a breadcrumb of type "Manual" and the desired level with the providedmessage string booleanaddBreadcrumb(String message, Map<String, Object> attributes)Add a breadcrumb of type "Manual" and level "Info" with the provided messagestring and attributes booleanaddBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbLevel level)Add a breadcrumb of type "Manual" and the desired level with the providedmessage string and attributes booleanaddBreadcrumb(String message, BacktraceBreadcrumbType type)Add a breadcrumb of the desired type and level "Info" with the providedmessage string booleanaddBreadcrumb(String message, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)Add a breadcrumb of the desired level and type with the provided messagestring booleanaddBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type)Add a breadcrumb of the desired type and level "Info" with the providedmessage string and attributes booleanaddBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)Add a breadcrumb of the desired level and type with the provided messagestring and attributes voidnativeCrash()native voiddumpWithoutCrash(String message)Force a native crash report and minidump submission native voiddumpWithoutCrash(String message, boolean setMainThreadAsFaultingThread)voidsend(BacktraceReport report)Sending an exception to Backtrace API voidsend(BacktraceReport sourceReport, OnServerResponseEventListener callback)Sending an exception to Backtrace API voidsendInnerExceptions(boolean sendInnerExceptions)Determine if Reports should be generated for inner exceptions. voidsendSuppressedExceptions(boolean sendSuppressedExceptions)Determine if Reports should be generated for suppressed exceptions. -
-
Constructor Detail
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace API
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIattachments- File attachment paths to consider for reports
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Map<String, Object> attributes)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIattributes- additional information about current application
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Map<String, Object> attributes, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIattributes- additional information about current applicationattachments- File attachment paths to consider for reports
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabaseSettings- Backtrace database settings
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabaseSettings- Backtrace database settingsattachments- File attachment paths to consider for reports
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabaseSettings- Backtrace database settingsattributes- additional information about current application
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabaseSettings- Backtrace database settingsattributes- additional information about current applicationattachments- File attachment paths to consider for reports
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Database database)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabase- Backtrace database
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Database database, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabase- Backtrace databaseattachments- File attachment paths to consider for reports
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabase- Backtrace databaseattributes- additional information about current application
-
BacktraceBase
BacktraceBase(Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes, List<String> attachments)
Initialize new client instance with BacktraceCredentials- Parameters:
context- context of current state of the applicationcredentials- Backtrace credentials to access Backtrace APIdatabase- Backtrace databaseattributes- additional information about current applicationattachments- File attachment paths to consider for reports
-
-
Method Detail
-
getAttributes
Map<String, Object> getAttributes()
Get custom attributes
-
getAttachments
List<String> getAttachments()
Get the set of file attachment paths that will be included with crash reportsand submissions.
-
crash
native void crash()
-
enableNativeIntegration
void enableNativeIntegration()
Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature).
-
enableNativeIntegration
void enableNativeIntegration(boolean enableClientSideUnwinding)
Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature).
- Parameters:
enableClientSideUnwinding- Enable client side unwinding
-
enableNativeIntegration
void enableNativeIntegration(boolean enableClientSideUnwinding, UnwindingMode unwindingMode)
Capture unhandled native exceptions (Backtrace database integration isrequired to enable this feature).
- Parameters:
enableClientSideUnwinding- Enable client side unwindingunwindingMode- Unwinding mode to use for client sideunwinding
-
disableNativeIntegration
void disableNativeIntegration()
-
enableProguard
void enableProguard()
Inform Backtrace API that we are using Proguard symbolication
-
addAttachment
void addAttachment(String attachmentPath)
Add a file attachment path to be included with crash reports and submissions.
- Parameters:
attachmentPath- the file path to attach to reports
-
addAttribute
void addAttribute(String key, Object value)
Adds a new attribute to Backtrace Client. If the native integration isenabled, adds the attributeto the native report attributes if:- the value exists (is not a null)- is not an object (the attribute value is primitive type like String, orInt)
- Parameters:
key- attribute namevalue- attribute value.
-
addAttribute
void addAttribute(Map<String, Object> attributes)
Adds new attributes to Backtrace Client. If the native integration isenabled, adds attributesto the native report attributes if:- the value exists (is not a null)- is not an object (the attribute value is primitive type like String, orInt)
- Parameters:
attributes- Map of attributes
-
setOnBeforeSendEventListener
void setOnBeforeSendEventListener(OnBeforeSendEventListener eventListener)
Set event executed before sending data to Backtrace API
- Parameters:
eventListener- object with method which will be executed
-
setOnServerErrorEventListener
void setOnServerErrorEventListener(OnServerErrorEventListener eventListener)
Set an event executed when received bad request, unauthorize request or otherinformation from server
- Parameters:
eventListener- object with method which will be executed
-
setOnRequestHandler
void setOnRequestHandler(RequestHandler requestHandler)
Custom request handler for sending Backtrace reports to server
- Parameters:
requestHandler- object with method which will be executed
-
enableBreadcrumbs
boolean enableBreadcrumbs(Context context)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context- context of current state of the application
-
enableBreadcrumbs
boolean enableBreadcrumbs(Context context, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context- context of current state of the applicationmaxBreadcrumbLogSizeBytes- breadcrumb log size limit in bytes, shouldbe a power of 2
-
enableBreadcrumbs
boolean enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context- context of current state of the applicationbreadcrumbTypesToEnable- a set containing which breadcrumb types toenable
-
enableBreadcrumbs
boolean enableBreadcrumbs(Context context, EnumSet<BacktraceBreadcrumbType> breadcrumbTypesToEnable, int maxBreadcrumbLogSizeBytes)
Enable logging of breadcrumbs and submission with crash reports
- Parameters:
context- context of current state of the applicationbreadcrumbTypesToEnable- a set containing which breadcrumb types toenablemaxBreadcrumbLogSizeBytes- breadcrumb log size limit in bytes, shouldbe a power of 2
-
clearBreadcrumbs
boolean clearBreadcrumbs()
Clear breadcrumb logs
-
addBreadcrumb
boolean addBreadcrumb(String message)
Add a breadcrumb of type "Manual" and level "Info" with the provided messagestring
- Parameters:
message- a message which describes this breadcrumb (1KB max)
-
addBreadcrumb
boolean addBreadcrumb(String message, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the providedmessage string
- Parameters:
message- a message which describes this breadcrumb (1KB max)level- the severity level of this breadcrumb
-
addBreadcrumb
boolean addBreadcrumb(String message, Map<String, Object> attributes)
Add a breadcrumb of type "Manual" and level "Info" with the provided messagestring and attributes
- Parameters:
message- a message which describes this breadcrumb (1KB max)attributes- key-value pairs to provide additional information aboutthis breadcrumb (1KB max, including some overhead perkey-value pair)
-
addBreadcrumb
boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbLevel level)
Add a breadcrumb of type "Manual" and the desired level with the providedmessage string and attributes
- Parameters:
message- a message which describes this breadcrumb (1KB max)attributes- key-value pairs to provide additional information aboutthis breadcrumb (1KB max, including some overhead perkey-value pair)level- the severity level of this breadcrumb
-
addBreadcrumb
boolean addBreadcrumb(String message, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the providedmessage string
- Parameters:
message- a message which describes this breadcrumb (1KB max)type- broadly describes the category of this breadcrumb
-
addBreadcrumb
boolean addBreadcrumb(String message, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided messagestring
- Parameters:
message- a message which describes this breadcrumb (1KB max)type- broadly describes the category of this breadcrumblevel- the severity level of this breadcrumb
-
addBreadcrumb
boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type)
Add a breadcrumb of the desired type and level "Info" with the providedmessage string and attributes
- Parameters:
message- a message which describes this breadcrumb (1KB max)attributes- key-value pairs to provide additional information aboutthis breadcrumb (1KB max, including some overhead perkey-value pair)type- broadly describes the category of this breadcrumb
-
addBreadcrumb
boolean addBreadcrumb(String message, Map<String, Object> attributes, BacktraceBreadcrumbType type, BacktraceBreadcrumbLevel level)
Add a breadcrumb of the desired level and type with the provided messagestring and attributes
- Parameters:
message- a message which describes this breadcrumb (1KB max)attributes- key-value pairs to provide additional information aboutthis breadcrumb (1KB max, including some overhead perkey-value pair)type- broadly describes the category of this breadcrumblevel- the severity level of this breadcrumb
-
nativeCrash
void nativeCrash()
-
dumpWithoutCrash
native void dumpWithoutCrash(String message)
Force a native crash report and minidump submission
-
dumpWithoutCrash
native void dumpWithoutCrash(String message, boolean setMainThreadAsFaultingThread)
-
send
void send(BacktraceReport report)
Sending an exception to Backtrace API
- Parameters:
report- current BacktraceReport
-
send
void send(BacktraceReport sourceReport, OnServerResponseEventListener callback)
Sending an exception to Backtrace API
- Parameters:
sourceReport- current BacktraceReport
-
sendInnerExceptions
void sendInnerExceptions(boolean sendInnerExceptions)
Determine if Reports should be generated for inner exceptions. By default thevalue is set to false.
- Parameters:
sendInnerExceptions- boolean flag that enabled/disable sending innerexceptions
-
sendSuppressedExceptions
void sendSuppressedExceptions(boolean sendSuppressedExceptions)
Determine if Reports should be generated for suppressed exceptions. Bydefault the value is set to false.
- Parameters:
sendSuppressedExceptions- boolean flag that enabled/disable sendingsuppressed exceptions
-
-
-
-