Class BacktraceClient

java.lang.Object
backtraceio.library.base.BacktraceBase
backtraceio.library.BacktraceClient
All Implemented Interfaces:
Client

public class BacktraceClient extends BacktraceBase
Backtrace Java Android Client
  • Constructor Details

    • BacktraceClient

      public BacktraceClient(android.content.Context context, BacktraceCredentials credentials)
      Initializing Backtrace client instance with BacktraceCredentials
      Parameters:
      context - application context
      credentials - 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 context
      credentials - credentials to Backtrace API server
      attachments - 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 context
      credentials - credentials to Backtrace API server
      attributes - 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 context
      credentials - credentials to Backtrace API server
      attributes - additional information about current application
      attachments - 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 application
      credentials - Backtrace credentials to access Backtrace API
      databaseSettings - 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 application
      credentials - Backtrace credentials to access Backtrace API
      databaseSettings - 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 application
      credentials - Backtrace credentials to access Backtrace API
      databaseSettings - Backtrace database settings
      attributes - 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 application
      credentials - Backtrace credentials to access Backtrace API
      databaseSettings - Backtrace database settings
      attributes - 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 application
      credentials - Backtrace credentials to access Backtrace API
      database - 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 application
      credentials - Backtrace credentials to access Backtrace API
      database - 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 application
      credentials - Backtrace credentials to access Backtrace API
      database - Backtrace database
      attributes - 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 application
      credentials - Backtrace credentials to access Backtrace API
      database - Backtrace database
      attributes - additional information about current application
      attachments - File attachment paths to consider for reports
  • Method Details

    • send

      public void send(String message)
      Sending a message to Backtrace API
      Parameters:
      message - custom client message
    • send

      public void send(String message, OnServerResponseEventListener serverResponseEventListener)
      Sending a message to Backtrace API
      Parameters:
      message - custom client message
      serverResponseEventListener - event callback that will be executed after receiving a response from the server
    • send

      public void send(Exception exception)
      Sending an exception to Backtrace API
      Parameters:
      exception - current exception
    • send

      public void send(Exception exception, OnServerResponseEventListener serverResponseEventListener)
      Sending an exception to Backtrace API
      Parameters:
      exception - current exception
      serverResponseEventListener - event callback that will be executed after receiving a response from the server
    • send

      public void send(BacktraceReport report)
      Sending a Backtrace report to Backtrace API
      Specified by:
      send in interface Client
      Overrides:
      send in class BacktraceBase
      Parameters:
      report - current BacktraceReport
    • send

      public void send(BacktraceReport report, OnServerResponseEventListener serverResponseEventListener)
      Sending a Backtrace report to Backtrace API
      Overrides:
      send in class BacktraceBase
      Parameters:
      report - current BacktraceReport
      serverResponseEventListener - 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

      public void enableAnr(int timeout, OnApplicationNotRespondingEvent onApplicationNotRespondingEvent)
      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
      onApplicationNotRespondingEvent - 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 hanged
      debug - 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 hanged
      onApplicationNotRespondingEvent - event that will be executed instead of the default sending of the error information to the Backtrace console
      debug - 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