Package backtraceio.library
Class BacktraceClient
java.lang.Object
backtraceio.library.base.BacktraceBase
backtraceio.library.BacktraceClient
- All Implemented Interfaces:
Client
Backtrace Java Android Client
-
Field Summary
Fields inherited from class backtraceio.library.base.BacktraceBase
attachments, attributes, context, database, metrics, version
-
Constructor Summary
ConstructorsConstructorDescriptionBacktraceClient
(android.content.Context context, BacktraceCredentials credentials) Initializing Backtrace client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Database database) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Database database, List<String> attachments) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Database database, Map<String, Object> attributes, List<String> attachments) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, List<String> attachments) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, BacktraceDatabaseSettings databaseSettings, Map<String, Object> attributes, List<String> attachments) Initialize new client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, List<String> attachments) Initializing Backtrace client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Map<String, Object> attributes) Initializing Backtrace client instance with BacktraceCredentialsBacktraceClient
(android.content.Context context, BacktraceCredentials credentials, Map<String, Object> attributes, List<String> attachments) Initializing Backtrace client instance with BacktraceCredentials -
Method Summary
Modifier and TypeMethodDescriptionvoid
Stop monitoring if the main thread has been blockedvoid
Start monitoring if the main thread has been blockedvoid
enableAnr
(int timeout) Start monitoring if the main thread has been blockedvoid
enableAnr
(int timeout, boolean debug) Start monitoring if the main thread has been blockedvoid
enableAnr
(int timeout, OnApplicationNotRespondingEvent onApplicationNotRespondingEvent) Start monitoring if the main thread has been blockedvoid
enableAnr
(int timeout, OnApplicationNotRespondingEvent onApplicationNotRespondingEvent, boolean debug) Start monitoring if the main thread has been blockedvoid
send
(BacktraceReport report) Sending a Backtrace report to Backtrace APIvoid
send
(BacktraceReport report, OnServerResponseEventListener serverResponseEventListener) Sending a Backtrace report to Backtrace APIvoid
Sending an exception to Backtrace APIvoid
send
(Exception exception, OnServerResponseEventListener serverResponseEventListener) Sending an exception to Backtrace APIvoid
Sending a message to Backtrace APIvoid
send
(String message, OnServerResponseEventListener serverResponseEventListener) Sending a message to Backtrace APIMethods inherited from class backtraceio.library.base.BacktraceBase
addAttribute, addAttribute, addBreadcrumb, addBreadcrumb, addBreadcrumb, addBreadcrumb, addBreadcrumb, addBreadcrumb, addBreadcrumb, addBreadcrumb, clearBreadcrumbs, crash, disableNativeIntegration, dumpWithoutCrash, dumpWithoutCrash, enableBreadcrumbs, enableBreadcrumbs, enableBreadcrumbs, enableBreadcrumbs, enableNativeIntegration, enableNativeIntegration, enableNativeIntegration, enableProguard, getAttributes, nativeCrash, setOnBeforeSendEventListener, setOnRequestHandler, setOnServerErrorEventListener
-
Constructor Details
-
BacktraceClient
Initializing Backtrace client instance with BacktraceCredentials- Parameters:
context
- application contextcredentials
- credentials to Backtrace API server
-
BacktraceClient
public BacktraceClient(android.content.Context context, BacktraceCredentials credentials, List<String> attachments) Initializing Backtrace client instance with BacktraceCredentials- Parameters:
context
- application contextcredentials
- credentials to Backtrace API serverattachments
- File attachment paths to consider for reports
-
BacktraceClient
public BacktraceClient(android.content.Context context, BacktraceCredentials credentials, Map<String, Object> attributes) Initializing Backtrace client instance with BacktraceCredentials- Parameters:
context
- application contextcredentials
- credentials to Backtrace API serverattributes
- additional information about current application
-
BacktraceClient
public BacktraceClient(android.content.Context context, BacktraceCredentials credentials, Map<String, Object> attributes, List<String> attachments) Initializing Backtrace client instance with BacktraceCredentials- Parameters:
context
- application contextcredentials
- credentials to Backtrace API serverattributes
- additional information about current applicationattachments
- File attachment paths to consider for reports
-
BacktraceClient
public BacktraceClient(android.content.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
-
BacktraceClient
public BacktraceClient(android.content.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 settings
-
BacktraceClient
public BacktraceClient(android.content.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
-
BacktraceClient
public BacktraceClient(android.content.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 application
-
BacktraceClient
public BacktraceClient(android.content.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
-
BacktraceClient
public BacktraceClient(android.content.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 database
-
BacktraceClient
public BacktraceClient(android.content.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
-
BacktraceClient
public BacktraceClient(android.content.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 Details
-
send
Sending a message to Backtrace API- Parameters:
message
- custom client message
-
send
Sending a message to Backtrace API- Parameters:
message
- custom client messageserverResponseEventListener
- event callback that will be executed after receiving a response from the server
-
send
Sending an exception to Backtrace API- Parameters:
exception
- current exception
-
send
Sending an exception to Backtrace API- Parameters:
exception
- current exceptionserverResponseEventListener
- event callback that will be executed after receiving a response from the server
-
send
Sending a Backtrace report to Backtrace API- Specified by:
send
in interfaceClient
- Overrides:
send
in classBacktraceBase
- Parameters:
report
- current BacktraceReport
-
send
Sending a Backtrace report to Backtrace API- Overrides:
send
in classBacktraceBase
- Parameters:
report
- current BacktraceReportserverResponseEventListener
- event callback that will be executed after receiving a response from the server
-
enableAnr
public void enableAnr()Start monitoring if the main thread has been blocked -
enableAnr
public void enableAnr(int timeout) Start monitoring if the main thread has been blocked- Parameters:
timeout
- maximum time in milliseconds after which should check if the main thread is not hanged
-
enableAnr
Start monitoring if the main thread has been blocked- Parameters:
timeout
- maximum time in milliseconds after which should check if the main thread is not hangedonApplicationNotRespondingEvent
- event that will be executed instead of the default sending of the error information to the Backtrace console
-
enableAnr
public void enableAnr(int timeout, boolean debug) Start monitoring if the main thread has been blocked- Parameters:
timeout
- maximum time in milliseconds after which should check if the main thread is not hangeddebug
- enable debug mode - errors will not be sent if the debugger is connected
-
enableAnr
public void enableAnr(int timeout, OnApplicationNotRespondingEvent onApplicationNotRespondingEvent, boolean debug) Start monitoring if the main thread has been blocked- Parameters:
timeout
- maximum time in milliseconds after which should check if the main thread is not hangedonApplicationNotRespondingEvent
- event that will be executed instead of the default sending of the error information to the Backtrace consoledebug
- enable debug mode - errors will not be sent if the debugger is connected
-
disableAnr
public void disableAnr()Stop monitoring if the main thread has been blocked
-