Class BacktraceClient

  • All Implemented Interfaces:
    Client

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

      • 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,
                               java.util.List<java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.Object> attributes,
                               java.util.List<java.lang.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,
                               java.util.List<java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.Object> attributes,
                               java.util.List<java.lang.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,
                               java.util.List<java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.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,
                               java.util.Map<java.lang.String,​java.lang.Object> attributes,
                               java.util.List<java.lang.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 Detail

      • send

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

        public void send​(java.lang.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​(java.lang.Exception exception)
        Sending an exception to Backtrace API
        Parameters:
        exception - current exception
      • send

        public void send​(java.lang.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