Package 

Object EmbraceSamples


  • 
    public class EmbraceSamples
    
                        

    Helps to verify and test embrace SDK integration. it allows users to execute code that automatically verifies the integration by calling the verifyIntegration method. It also provides example code to generate ANR and JVM/NDK crashes

    • Method Summary

      Modifier and Type Method Description
      final static Unit verifyIntegration() Starts an automatic verification of the following Embrace features:
      • Log a Breadcrumb

      • Set user data

      • Add info, warning and error logs

      • Start and end a moment

      • Executes a GET request

      • Add the trace id to the request (default or the one specified in the local config)

      • Check the current and the latest SDK version

      • Execute a POST request

      • Execute a bad request

      • Trigger an ANR

      • Throw an Exception (yep, the application will be relaunch)

      Then, that information can be verified in user sessions dashboard
      final static Unit throwJvmException() Throw a custom JVM crash to be part of current session.
      final static Unit triggerAnr() Force a short ANR that lasts 4 seconds
      final static Unit triggerLongAnr() Force a long ANR that lasts 30 seconds
      final static Unit causeNdkIllegalInstruction() Throws a ndk SigIllegalInstruction
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • verifyIntegration

         final static Unit verifyIntegration()

        Starts an automatic verification of the following Embrace features:

        • Log a Breadcrumb

        • Set user data

        • Add info, warning and error logs

        • Start and end a moment

        • Executes a GET request

        • Add the trace id to the request (default or the one specified in the local config)

        • Check the current and the latest SDK version

        • Execute a POST request

        • Execute a bad request

        • Trigger an ANR

        • Throw an Exception (yep, the application will be relaunch)

        Then, that information can be verified in user sessions dashboard

      • throwJvmException

         final static Unit throwJvmException()

        Throw a custom JVM crash to be part of current session.

        It is recommended to implement this method call via a button press once the app has loaded.

        After a crash is sent, the app should be restarted in order to see the error in the dashboard.

      • triggerAnr

         final static Unit triggerAnr()

        Force a short ANR that lasts 4 seconds

      • triggerLongAnr

         final static Unit triggerLongAnr()

        Force a long ANR that lasts 30 seconds