public class CrashManager
extends java.lang.Object
Constructor and Description |
---|
CrashManager() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext)
Deletes all stack traces and meta files from files dir.
|
static java.util.concurrent.Future<java.lang.Boolean> |
didCrashInLastSession() |
static void |
execute(android.content.Context context,
CrashManagerListener listener)
Executes the crash manager.
|
static long |
getInitializeTimestamp() |
static java.util.concurrent.Future<CrashDetails> |
getLastCrashDetails(android.content.Context context) |
static boolean |
handleUserInput(CrashManagerUserInput userInput,
CrashMetaData userProvidedMetaData,
CrashManagerListener listener,
java.lang.ref.WeakReference<android.content.Context> weakContext,
boolean ignoreDefaultHandler)
Provides an interface to pass user input from a custom alert to a crash report
|
static int |
hasStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext)
Checks if there are any saved stack traces in the files dir.
|
static void |
initialize(android.content.Context context,
java.lang.String appIdentifier,
CrashManagerListener listener)
Initializes the crash manager, but does not handle crash log.
|
static void |
initialize(android.content.Context context,
java.lang.String urlString,
java.lang.String appIdentifier,
CrashManagerListener listener)
Initializes the crash manager, but does not handle crash log.
|
static void |
register(android.content.Context context)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
CrashManagerListener listener)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
java.lang.String appIdentifier)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
java.lang.String appIdentifier,
CrashManagerListener listener)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
java.lang.String urlString,
java.lang.String appIdentifier,
CrashManagerListener listener)
Registers new crash manager and handles existing crash logs.
|
static void |
resetAlwaysSend(java.lang.ref.WeakReference<android.content.Context> weakContext)
Clears the preference to always send crashes.
|
static void |
submitStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext,
CrashManagerListener listener)
Submits all stack traces in the files dir to HockeyApp.
|
static void |
submitStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext,
CrashManagerListener listener,
CrashMetaData crashMetaData)
Submits all stack traces in the files dir to HockeyApp.
|
public static void register(android.content.Context context)
context
- The context to use. Usually your Activity object. If
context is not an instance of Activity (or a subclass of it),
crashes will be sent automatically.public static void register(android.content.Context context, CrashManagerListener listener)
context
- The context to use. Usually your Activity object. If
context is not an instance of Activity (or a subclass of it),
crashes will be sent automatically.listener
- Implement for callback functions.public static void register(android.content.Context context, java.lang.String appIdentifier)
context
- The context to use. Usually your Activity object.appIdentifier
- App ID of your app on HockeyApp.public static void register(android.content.Context context, java.lang.String appIdentifier, CrashManagerListener listener)
context
- The context to use. Usually your Activity object.appIdentifier
- App ID of your app on HockeyApp.listener
- Implement for callback functions.public static void register(android.content.Context context, java.lang.String urlString, java.lang.String appIdentifier, CrashManagerListener listener)
context
- The context to use. Usually your Activity object.urlString
- URL of the HockeyApp server.appIdentifier
- App ID of your app on HockeyApp.listener
- Implement for callback functions.public static void initialize(android.content.Context context, java.lang.String appIdentifier, CrashManagerListener listener)
context
- The context to use. Usually your Activity object.appIdentifier
- App ID of your app on HockeyApp.listener
- Implement for callback functions.public static void initialize(android.content.Context context, java.lang.String urlString, java.lang.String appIdentifier, CrashManagerListener listener)
context
- The context to use. Usually your Activity object.urlString
- URL of the HockeyApp server.appIdentifier
- App ID of your app on HockeyApp.listener
- Implement for callback functions.public static void execute(android.content.Context context, CrashManagerListener listener)
context
- The context to use. Usually your Activity object.listener
- Implement for callback functions.public static int hasStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.public static java.util.concurrent.Future<java.lang.Boolean> didCrashInLastSession()
public static java.util.concurrent.Future<CrashDetails> getLastCrashDetails(android.content.Context context)
public static void submitStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext, CrashManagerListener listener)
weakContext
- The context to use. Usually your Activity object.listener
- Implement for callback functions.public static void submitStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext, CrashManagerListener listener, CrashMetaData crashMetaData)
weakContext
- The context to use. Usually your Activity object.listener
- Implement for callback functions.crashMetaData
- The crashMetaData, provided by the user.public static void deleteStackTraces(java.lang.ref.WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.public static boolean handleUserInput(CrashManagerUserInput userInput, CrashMetaData userProvidedMetaData, CrashManagerListener listener, java.lang.ref.WeakReference<android.content.Context> weakContext, boolean ignoreDefaultHandler)
userInput
- Defines the users action whether to send, always send, or not to send the crash report.userProvidedMetaData
- The content of this optional CrashMetaData instance will be attached to the crash report
and allows to ask the user for e.g. additional comments or info.listener
- an optional crash manager listener to use.weakContext
- The context to use. Usually your Activity object.ignoreDefaultHandler
- whether to ignore the default exception handler.CrashManagerUserInput
,
CrashMetaData
,
CrashManagerListener
public static void resetAlwaysSend(java.lang.ref.WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.public static long getInitializeTimestamp()