public final class Mint
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
XSplunkMintSessionIdHeader
The header name to use for HTTP.
|
static java.lang.String |
XSplunkMintUuidHeader
The header name to use for HTTP.
|
Constructor and Description |
---|
Mint() |
Modifier and Type | Method and Description |
---|---|
static void |
addExtraData(java.lang.String key,
java.lang.String value)
Adds a key-value pair to the extra data.
|
static void |
addExtraDataMap(java.util.HashMap<java.lang.String,java.lang.Object> extras)
Adds a map to the extra data.
|
static void |
addURLToBlackList(java.lang.String url)
Adds a URL to the network monitoring blacklist.
|
static void |
clearExtraData()
Clears all extra data.
|
static void |
clearTotalCrashesNum()
Clears the total number of crashes.
|
static void |
closeSession(Context context)
Closes the active session.
|
static void |
disableNetworkMonitoring()
Disables network monitoring.
|
static void |
enableDebug()
Enables the display of debug messages.
**Note** You should turn this feature off in production. |
static void |
enableLogging(boolean enable)
Enables LogCat logging.
|
static void |
flush()
Flushes all saved data.
|
static JSONObject |
getDevSettings()
Gets the developer settings from the Remote Settings.
|
static java.util.HashMap<java.lang.String,java.lang.Object> |
getExtraData()
Gets the extra data map.
|
static java.lang.String |
getLastCrashID()
Gets the error hash of the last crash.
|
static java.lang.String |
getMintUUID()
Returns the MINT universally unique identifier (UUID), which uniquely
identifies a specific user.
|
static java.lang.String |
getSessionId()
Returns the current session ID.
|
static int |
getTotalCrashesNum()
Gets the total number of crashes.
|
static void |
initAndStartSession(Context context,
java.lang.String apiKey)
Use this constructor to initialize and start the session.
|
static void |
leaveBreadcrumb(java.lang.String breadcrumb)
Leaves a breadcrumb at a point of interest in your code.
|
static void |
logEvent(java.lang.String eventName)
Logs an event and uses the default log level `Verbose`.
|
static void |
logEvent(java.lang.String eventName,
MintLogLevel logLevel)
Logs an event with a specific log level.
|
static void |
logEvent(java.lang.String eventName,
MintLogLevel logLevel,
java.util.HashMap<java.lang.String,java.lang.Object> customData)
Logs an event with a specific log level.
|
static void |
logEvent(java.lang.String eventName,
MintLogLevel logLevel,
java.lang.String keyName,
java.lang.String keyValue)
Logs an event with a specific log level.
|
static void |
logException(java.lang.Exception ex)
Submits a handled exception (if inside a `try-catch` block) and a map of
custom data.
|
static void |
logExceptionMap(java.util.HashMap<java.lang.String,java.lang.Object> customData,
java.lang.Exception exception)
Submits a handled exception (if inside a `try-catch` block) and a map of
custom data.
|
static void |
logExceptionMessage(java.lang.String key,
java.lang.String value,
java.lang.Exception exception)
Submits a handled exception (if inside a `try-catch` block) and a custom
key-value pair.
|
static void |
logView(java.lang.String view)
Logs a specific view as a Splunk data type.
|
static void |
logView(java.lang.String view,
java.util.HashMap<java.lang.String,java.lang.Object> extraData)
Logs a specific view as a Splunk data type.
|
static void |
removeExtraData(java.lang.String key)
Removes a specific key-value pair from the extra data.
|
static void |
setFlushOnlyOverWiFi(boolean enabled)
Enables MINT to flush data only when there is a WiFi connection.
**Note** Be sure to add the ACCESS_NETWORK_STATE permission to your AndroidManifest.xml file. |
static void |
setLogging(int lines)
Restricts the number of lines in the LogCat output.
|
static void |
setLogging(int lines,
java.lang.String filter)
Restricts the number of lines in the LogCat output and sets a LogCat
filter string.
|
static void |
setLogging(java.lang.String filter)
Sets a LogCat filter string.
|
static void |
setMintCallback(MintCallback mintCallback)
Sets a Mint callback interface, which is used for the **lastBreath**
callback, the **netSaverResponse** callback, and the
**dataSaverResponse** callback.
|
static void |
setUserIdentifier(java.lang.String userIdentifier)
Sets an identifier for the current user.
|
static void |
setUserOptOut(boolean optedOut)
Indicates whether to prevent MINT from saving or sending any data for the
user.
|
static void |
startSession(Context context)
Starts a new session.
|
static void |
transactionCancel(java.lang.String name,
java.lang.String reason)
Cancels a transaction.
|
static void |
transactionCancel(java.lang.String name,
java.lang.String reason,
java.util.HashMap<java.lang.String,java.lang.Object> customData)
Cancels a transaction.
|
static void |
transactionCancel(java.lang.String name,
java.lang.String reason,
java.lang.String keyName,
java.lang.String keyValue)
Cancels a transaction.
|
static void |
transactionStart(java.lang.String name)
Starts a transaction.
|
static void |
transactionStart(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.Object> customData)
Starts a transaction.
|
static void |
transactionStart(java.lang.String name,
java.lang.String keyName,
java.lang.String keyValue)
Starts a transaction.
|
static void |
transactionStop(java.lang.String name)
Stops a transaction.
|
static void |
transactionStop(java.lang.String name,
java.util.HashMap<java.lang.String,java.lang.Object> customData)
Stops a transaction.
|
static void |
transactionStop(java.lang.String name,
java.lang.String keyName,
java.lang.String keyValue)
Stops a transaction.
|
static void |
xamarinException(java.lang.Exception exception,
boolean handled,
java.util.HashMap<java.lang.String,java.lang.Object> customData)
Used to report exceptions from Xamarin
|
public static final java.lang.String XSplunkMintSessionIdHeader
public static final java.lang.String XSplunkMintUuidHeader
public static void initAndStartSession(Context context, java.lang.String apiKey)
Use this constructor to initialize and start the session. This constructor validates the API key, initializes the plugin environment, installs the exception handler, and sends a PING request or a PING_WITH_SETTINGS request to receive new remote settings.
context
- The context of the application.apiKey
- The API key you received for the project.public static void startSession(Context context)
context
- The context of the application.public static void closeSession(Context context)
context
- The context of the application.public static void flush()
public static void setUserOptOut(boolean optedOut)
optedOut
- `true` to enable user opt-out, `false` to disable it.public static void disableNetworkMonitoring()
public static final void setMintCallback(MintCallback mintCallback)
mintCallback
- The Mint callback interface.public static void leaveBreadcrumb(java.lang.String breadcrumb)
breadcrumb
- The name of the breadcrumb.public static void logView(java.lang.String view)
view
- The name of the view.public static void logView(java.lang.String view, java.util.HashMap<java.lang.String,java.lang.Object> extraData)
extraData
- Extra data.view
- The name of the view.public static void logEvent(java.lang.String eventName)
eventName
- The name of the event.public static void logEvent(java.lang.String eventName, MintLogLevel logLevel)
eventName
- The name of the event.logLevel
- The log level of the event.public static void logEvent(java.lang.String eventName, MintLogLevel logLevel, java.util.HashMap<java.lang.String,java.lang.Object> customData)
eventName
- The name of the event.logLevel
- The log level of the event.customData
- The HashMap containing custom data.public static void logEvent(java.lang.String eventName, MintLogLevel logLevel, java.lang.String keyName, java.lang.String keyValue)
eventName
- The name of the event.logLevel
- The log level of the event.keyName
- The key name for extra data.keyValue
- The value of extra data.public static void setUserIdentifier(java.lang.String userIdentifier)
userIdentifier
- The user identifier, such as a random ID, an email address, or
a user name.public static void enableDebug()
public static void setFlushOnlyOverWiFi(boolean enabled)
enabled
- `true` to enable sending date over WiFi only, `false` to
disable it.public static void transactionStart(java.lang.String name)
name
- The name of the transaction.public static void transactionStart(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.Object> customData)
name
- The name of the transaction.customData
- The HashMap containing custom data.public static void transactionStart(java.lang.String name, java.lang.String keyName, java.lang.String keyValue)
name
- The name of the transaction.keyName
- The key name for extra data.keyValue
- The value of extra data.public static void transactionStop(java.lang.String name)
name
- The name of the transaction.public static void transactionStop(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.Object> customData)
name
- The name of the transaction.customData
- The HashMap containing custom data.public static void transactionStop(java.lang.String name, java.lang.String keyName, java.lang.String keyValue)
name
- The name of the transaction.keyName
- The key name for extra data.keyValue
- The value of extra data.public static void transactionCancel(java.lang.String name, java.lang.String reason)
name
- The name of the transaction.reason
- The reason for canceling the transaction. This value can be
`null` or empty.public static void transactionCancel(java.lang.String name, java.lang.String reason, java.util.HashMap<java.lang.String,java.lang.Object> customData)
name
- The name of the transaction.reason
- The reason for canceling the transaction. This value can be
`null` or empty.customData
- The HashMap containing custom data.public static void transactionCancel(java.lang.String name, java.lang.String reason, java.lang.String keyName, java.lang.String keyValue)
name
- The name of the transaction.reason
- The reason for canceling the transaction. This value can be
`null` or empty.keyName
- The key name for extra data.keyValue
- The value of extra data.public static java.util.HashMap<java.lang.String,java.lang.Object> getExtraData()
public static void addExtraData(java.lang.String key, java.lang.String value)
key
- The key.value
- The value.public static void addExtraDataMap(java.util.HashMap<java.lang.String,java.lang.Object> extras)
extras
- The map of extra data.public static void removeExtraData(java.lang.String key)
key
- The key to remove.public static void clearExtraData()
public static int getTotalCrashesNum()
public static void clearTotalCrashesNum()
public static java.lang.String getLastCrashID()
public static void logExceptionMap(java.util.HashMap<java.lang.String,java.lang.Object> customData, java.lang.Exception exception)
customData
- The HashMap containing custom data.exception
- The handled exception.public static void logException(java.lang.Exception ex)
ex
- The handled exception.public static void logExceptionMessage(java.lang.String key, java.lang.String value, java.lang.Exception exception)
key
- The key.value
- The value.exception
- The handled exception.public static void xamarinException(java.lang.Exception exception, boolean handled, java.util.HashMap<java.lang.String,java.lang.Object> customData)
exception
- handled
- customData
- public static void enableLogging(boolean enable)
enable
- `true` to enable LogCat logging, `false` to disable it.public static void setLogging(int lines)
lines
- The number of lines to report.public static void setLogging(java.lang.String filter)
filter
- The filter expression. For more information, see [ Filtering
Log
Output](http://developer.android.com/tools/debugging/debugging
-log.html#filteringOutput) on the Android Developers website.public static void setLogging(int lines, java.lang.String filter)
lines
- The number of lines to report.filter
- The filter expression. For more information, see [ Filtering
Log
Output](http://developer.android.com/tools/debugging/debugging
-log.html#filteringOutput) on the Android Developers website.public static JSONObject getDevSettings()
public static void addURLToBlackList(java.lang.String url)
url
- The URL to ignore.public static final java.lang.String getSessionId()
public static final java.lang.String getMintUUID()