public class CrashManager extends Object
Copyright (c) 2011-2014 Bit Stadium GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Constructor and Description |
---|
CrashManager() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteStackTraces(WeakReference<android.content.Context> weakContext)
Deletes all stack traces and meta files from files dir.
|
static void |
execute(android.content.Context context,
CrashManagerListener listener)
Executes the crash manager.
|
static boolean |
handleUserInput(CrashManagerUserInput userInput,
CrashMetaData userProvidedMetaData,
CrashManagerListener listener,
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(WeakReference<android.content.Context> weakContext)
Checks if there are any saved stack traces in the files dir.
|
static void |
initialize(android.content.Context context,
String appIdentifier,
CrashManagerListener listener)
Initializes the crash manager, but does not handle crash log.
|
static void |
initialize(android.content.Context context,
String urlString,
String appIdentifier,
CrashManagerListener listener)
Initializes the crash manager, but does not handle crash log.
|
static void |
register(android.content.Context context,
String appIdentifier)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
String appIdentifier,
CrashManagerListener listener)
Registers new crash manager and handles existing crash logs.
|
static void |
register(android.content.Context context,
String urlString,
String appIdentifier,
CrashManagerListener listener)
Registers new crash manager and handles existing crash logs.
|
static void |
resetAlwaysSend(WeakReference<android.content.Context> weakContext)
Clears the preference to always send crashes.
|
static void |
submitStackTraces(WeakReference<android.content.Context> weakContext,
CrashManagerListener listener)
Submits all stack traces in the files dir to HockeyApp.
|
static void |
submitStackTraces(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, 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, 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, String urlString, 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, 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, String urlString, 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(WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.public static void submitStackTraces(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(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(WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.public static boolean handleUserInput(CrashManagerUserInput userInput, CrashMetaData userProvidedMetaData, CrashManagerListener listener, 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(WeakReference<android.content.Context> weakContext)
weakContext
- The context to use. Usually your Activity object.Copyright © 2015. All Rights Reserved.