Package xcrash

Class XCrash


  • public final class XCrash
    extends java.lang.Object
    xCrash is a crash reporting library for Android APP.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  XCrash.InitParameters
      An initialization parameter set.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String nativeLibDir  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getLogDir()  
      static int init​(android.content.Context ctx)
      Initialize xCrash with default parameters.
      static int init​(android.content.Context ctx, XCrash.InitParameters params)
      Initialize xCrash with custom parameters.
      static void testJavaCrash​(boolean runInNewThread)
      Force a java exception.
      static void testNativeCrash​(boolean runInNewThread)
      Force a native crash.
      • Methods inherited from class java.lang.Object

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

      • nativeLibDir

        public static java.lang.String nativeLibDir
    • Method Detail

      • init

        public static int init​(android.content.Context ctx)
        Initialize xCrash with default parameters.

        Note: This is a synchronous operation.

        Parameters:
        ctx - The context of the application object of the current process.
        Returns:
        Return zero if successful, non-zero otherwise. The error code is defined in: Errno.
      • init

        public static int init​(android.content.Context ctx,
                               XCrash.InitParameters params)
        Initialize xCrash with custom parameters.

        Note: This is a synchronous operation.

        Parameters:
        ctx - The context of the application object of the current process.
        params - An initialization parameter set.
        Returns:
        Return zero if successful, non-zero otherwise. The error code is defined in: Errno.
      • getLogDir

        public static java.lang.String getLogDir()
      • testJavaCrash

        public static void testJavaCrash​(boolean runInNewThread)
                                  throws java.lang.RuntimeException
        Force a java exception.

        Warning: This method is for testing purposes only. Don't call it in a release version of your APP.

        Parameters:
        runInNewThread - Whether it is triggered in the current thread.
        Throws:
        java.lang.RuntimeException - This exception will terminate current process.
      • testNativeCrash

        public static void testNativeCrash​(boolean runInNewThread)
        Force a native crash.

        Warning: This method is for testing purposes only. Don't call it in a release version of your APP.

        Parameters:
        runInNewThread - Whether it is triggered in the current thread.