Package xcrash
Class XCrash
- java.lang.Object
-
- xcrash.XCrash
-
public final class XCrash extends java.lang.ObjectxCrash is a crash reporting library for Android APP.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXCrash.InitParametersAn initialization parameter set.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringnativeLibDir
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetLogDir()static intinit(android.content.Context ctx)Initialize xCrash with default parameters.static intinit(android.content.Context ctx, XCrash.InitParameters params)Initialize xCrash with custom parameters.static voidtestJavaCrash(boolean runInNewThread)Force a java exception.static voidtestNativeCrash(boolean runInNewThread)Force a native crash.
-
-
-
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.RuntimeExceptionForce 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.
-
-