Splunk MINT SDK for Android  4.4
 All Classes Namespaces Files Functions Variables
com.splunk.mint.Mint Class Reference

Static Public Member Functions

static void initAndStartSession (final Context context, final String apiKey)
 
static void startSession (final Context context)
 
static void closeSession (final Context context)
 
static void flush ()
 
static void setUserOptOut (final boolean optedOut)
 
static void disableNetworkMonitoring ()
 
static final void setMintCallback (MintCallback mintCallback)
 
static void leaveBreadcrumb (final String breadcrumb)
 
static void logView (final String view)
 
static void logView (final String view, HashMap< String, Object > extraData)
 
static void logEvent (final String eventName)
 
static void logEvent (final String eventName, final MintLogLevel logLevel)
 
static void logEvent (final String eventName, final MintLogLevel logLevel, final HashMap< String, Object > customData)
 
static void logEvent (final String eventName, final MintLogLevel logLevel, final String keyName, final String keyValue)
 
static void setUserIdentifier (final String userIdentifier)
 
static void enableDebug ()
 
static void setFlushOnlyOverWiFi (boolean enabled)
 
static void transactionStart (final String name)
 
static void transactionStart (final String name, final HashMap< String, Object > customData)
 
static void transactionStart (final String name, final String keyName, final String keyValue)
 
static void transactionStop (final String name)
 
static void transactionStop (final String name, final HashMap< String, Object > customData)
 
static void transactionStop (final String name, final String keyName, final String keyValue)
 
static void transactionCancel (final String name, final String reason)
 
static void transactionCancel (final String name, final String reason, final HashMap< String, Object > customData)
 
static void transactionCancel (final String name, final String reason, final String keyName, final String keyValue)
 
static HashMap< String, Object > getExtraData ()
 
static void addExtraData (final String key, String value)
 
static void addExtraDataMap (final HashMap< String, Object > extras)
 
static void removeExtraData (final String key)
 
static void clearExtraData ()
 
static int getTotalCrashesNum ()
 
static void clearTotalCrashesNum ()
 
static String getLastCrashID ()
 
static void logExceptionMap (final HashMap< String, Object > customData, final Exception exception)
 
static void logException (final Exception ex)
 
static void logExceptionMessage (final String key, final String value, final Exception exception)
 
static void xamarinException (final Exception exception, final boolean handled, final HashMap< String, Object > customData)
 
static void enableLogging (final boolean enable)
 
static void setLogging (final int lines)
 
static void setLogging (final String filter)
 
static void setLogging (final int lines, final String filter)
 
static JSONObject getDevSettings ()
 
static void addURLToBlackList (final String url)
 
static final String getSessionId ()
 
static final String getMintUUID ()
 

Static Public Attributes

static final String XSplunkMintSessionIdHeader = "X-Splunk-Mint-Session-id"
 
static final String XSplunkMintUuidHeader = "X-Splunk-Mint-uuid"
 

Detailed Description

The Mint class represents the main class for the Splunk MINT SDK for Android.

Author
Konstantinos Polychronis kp@sp.nosp@m.lunk.nosp@m..com

Member Function Documentation

static void com.splunk.mint.Mint.addExtraData ( final String  key,
String  value 
)
inlinestatic

Adds a key-value pair to the extra data.

Parameters
keyThe key.
valueThe value.
static void com.splunk.mint.Mint.addExtraDataMap ( final HashMap< String, Object >  extras)
inlinestatic

Adds a map to the extra data.

Parameters
extrasThe map of extra data.
static void com.splunk.mint.Mint.addURLToBlackList ( final String  url)
inlinestatic

Adds a URL to the network monitoring blacklist. Network calls with this URL are ignored.

Parameters
urlThe URL to ignore.
static void com.splunk.mint.Mint.clearExtraData ( )
inlinestatic

Clears all extra data.

static void com.splunk.mint.Mint.clearTotalCrashesNum ( )
inlinestatic

Clears the total number of crashes. This method is blocking, so it must run on a new thread or as an AsyncTask.

static void com.splunk.mint.Mint.closeSession ( final Context  context)
inlinestatic

Closes the active session.

Parameters
contextThe context of the application.
static void com.splunk.mint.Mint.disableNetworkMonitoring ( )
inlinestatic

Disables network monitoring. You must call this before the initAndStartSession method.

static void com.splunk.mint.Mint.enableDebug ( )
inlinestatic

Enables the display of debug messages.
Note You should turn this feature off in production.

static void com.splunk.mint.Mint.enableLogging ( final boolean  enable)
inlinestatic

Enables LogCat logging.

Parameters
enabletrue to enable LogCat logging, false to disable it.
static void com.splunk.mint.Mint.flush ( )
inlinestatic

Flushes all saved data.

static JSONObject com.splunk.mint.Mint.getDevSettings ( )
inlinestatic

Gets the developer settings from the Remote Settings.

Returns
The names and values for each setting.
static HashMap<String, Object> com.splunk.mint.Mint.getExtraData ( )
inlinestatic

Gets the extra data map.

Returns
The map of crash extra data.
static String com.splunk.mint.Mint.getLastCrashID ( )
inlinestatic

Gets the error hash of the last crash. This method is blocking, so it must run on a new thread or as an AsyncTask.

Returns
The error hash of the last crash, or null if no crash.
static final String com.splunk.mint.Mint.getMintUUID ( )
inlinestatic

Returns the MINT universally unique identifier (UUID), which uniquely identifies a specific user.

Returns
The UUID of the user.
static final String com.splunk.mint.Mint.getSessionId ( )
inlinestatic

Returns the current session ID.

Returns
The session ID.
static int com.splunk.mint.Mint.getTotalCrashesNum ( )
inlinestatic

Gets the total number of crashes. This method is blocking, so it must run on a new thread or as an AsyncTask.

Returns
An integer indicating the number of crashes.
static void com.splunk.mint.Mint.initAndStartSession ( final Context  context,
final String  apiKey 
)
inlinestatic

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.

Parameters
contextThe context of the application.
apiKeyThe API key you received for the project.
static void com.splunk.mint.Mint.leaveBreadcrumb ( final String  breadcrumb)
inlinestatic

Leaves a breadcrumb at a point of interest in your code.

Parameters
breadcrumbThe name of the breadcrumb.
static void com.splunk.mint.Mint.logEvent ( final String  eventName)
inlinestatic

Logs an event and uses the default log level Verbose.

Parameters
eventNameThe name of the event.
static void com.splunk.mint.Mint.logEvent ( final String  eventName,
final MintLogLevel  logLevel 
)
inlinestatic

Logs an event with a specific log level.

Parameters
eventNameThe name of the event.
logLevelThe log level of the event.
static void com.splunk.mint.Mint.logEvent ( final String  eventName,
final MintLogLevel  logLevel,
final HashMap< String, Object >  customData 
)
inlinestatic

Logs an event with a specific log level.

Parameters
eventNameThe name of the event.
logLevelThe log level of the event.
customDataThe HashMap containing custom data.
static void com.splunk.mint.Mint.logEvent ( final String  eventName,
final MintLogLevel  logLevel,
final String  keyName,
final String  keyValue 
)
inlinestatic

Logs an event with a specific log level.

Parameters
eventNameThe name of the event.
logLevelThe log level of the event.
keyNameThe key name for extra data.
keyValueThe value of extra data.
static void com.splunk.mint.Mint.logException ( final Exception  ex)
inlinestatic

Submits a handled exception (if inside a try-catch block) and a map of custom data.

Parameters
exThe handled exception.
static void com.splunk.mint.Mint.logExceptionMap ( final HashMap< String, Object >  customData,
final Exception  exception 
)
inlinestatic

Submits a handled exception (if inside a try-catch block) and a map of custom data.

Parameters
customDataThe HashMap containing custom data.
exceptionThe handled exception.
static void com.splunk.mint.Mint.logExceptionMessage ( final String  key,
final String  value,
final Exception  exception 
)
inlinestatic

Submits a handled exception (if inside a try-catch block) and a custom key-value pair.

Parameters
keyThe key.
valueThe value.
exceptionThe handled exception.
static void com.splunk.mint.Mint.logView ( final String  view)
inlinestatic

Logs a specific view as a Splunk data type.

Parameters
viewThe name of the view.
static void com.splunk.mint.Mint.logView ( final String  view,
HashMap< String, Object >  extraData 
)
inlinestatic

Logs a specific view as a Splunk data type.

Parameters
extraDataExtra data.
viewThe name of the view.
static void com.splunk.mint.Mint.removeExtraData ( final String  key)
inlinestatic

Removes a specific key-value pair from the extra data.

Parameters
keyThe key to remove.
static void com.splunk.mint.Mint.setFlushOnlyOverWiFi ( boolean  enabled)
inlinestatic

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.

Parameters
enabledtrue to enable sending date over WiFi only, false to disable it.
static void com.splunk.mint.Mint.setLogging ( final int  lines)
inlinestatic

Restricts the number of lines in the LogCat output.

Parameters
linesThe number of lines to report.
static void com.splunk.mint.Mint.setLogging ( final String  filter)
inlinestatic

Sets a LogCat filter string.

Parameters
filterThe filter expression. For more information, see [ Filtering Log Output](http://developer.android.com/tools/debugging/debugging -log.html#filteringOutput) on the Android Developers website.
static void com.splunk.mint.Mint.setLogging ( final int  lines,
final String  filter 
)
inlinestatic

Restricts the number of lines in the LogCat output and sets a LogCat filter string.

Parameters
linesThe number of lines to report.
filterThe filter expression. For more information, see [ Filtering Log Output](http://developer.android.com/tools/debugging/debugging -log.html#filteringOutput) on the Android Developers website.
static final void com.splunk.mint.Mint.setMintCallback ( MintCallback  mintCallback)
inlinestatic

Sets a Mint callback interface, which is used for the lastBreath callback, the netSaverResponse callback, and the dataSaverResponse callback.

Parameters
mintCallbackThe Mint callback interface.
static void com.splunk.mint.Mint.setUserIdentifier ( final String  userIdentifier)
inlinestatic

Sets an identifier for the current user.

Parameters
userIdentifierThe user identifier, such as a random ID, an email address, or a user name.
static void com.splunk.mint.Mint.setUserOptOut ( final boolean  optedOut)
inlinestatic

Indicates whether to prevent MINT from saving or sending any data for the user.

Parameters
optedOuttrue to enable user opt-out, false to disable it.
static void com.splunk.mint.Mint.startSession ( final Context  context)
inlinestatic

Starts a new session. This method checks the sent time of the last PING request and creates a new one if more than 60 seconds have passed.

Parameters
contextThe context of the application.
static void com.splunk.mint.Mint.transactionCancel ( final String  name,
final String  reason 
)
inlinestatic

Cancels a transaction.

Parameters
nameThe name of the transaction.
reasonThe reason for canceling the transaction. This value can be null or empty.
static void com.splunk.mint.Mint.transactionCancel ( final String  name,
final String  reason,
final HashMap< String, Object >  customData 
)
inlinestatic

Cancels a transaction.

Parameters
nameThe name of the transaction.
reasonThe reason for canceling the transaction. This value can be null or empty.
customDataThe HashMap containing custom data.
static void com.splunk.mint.Mint.transactionCancel ( final String  name,
final String  reason,
final String  keyName,
final String  keyValue 
)
inlinestatic

Cancels a transaction.

Parameters
nameThe name of the transaction.
reasonThe reason for canceling the transaction. This value can be null or empty.
keyNameThe key name for extra data.
keyValueThe value of extra data.
static void com.splunk.mint.Mint.transactionStart ( final String  name)
inlinestatic

Starts a transaction.

Parameters
nameThe name of the transaction.
static void com.splunk.mint.Mint.transactionStart ( final String  name,
final HashMap< String, Object >  customData 
)
inlinestatic

Starts a transaction.

Parameters
nameThe name of the transaction.
customDataThe HashMap containing custom data.
static void com.splunk.mint.Mint.transactionStart ( final String  name,
final String  keyName,
final String  keyValue 
)
inlinestatic

Starts a transaction.

Parameters
nameThe name of the transaction.
keyNameThe key name for extra data.
keyValueThe value of extra data.
static void com.splunk.mint.Mint.transactionStop ( final String  name)
inlinestatic

Stops a transaction.

Parameters
nameThe name of the transaction.
static void com.splunk.mint.Mint.transactionStop ( final String  name,
final HashMap< String, Object >  customData 
)
inlinestatic

Stops a transaction.

Parameters
nameThe name of the transaction.
customDataThe HashMap containing custom data.
static void com.splunk.mint.Mint.transactionStop ( final String  name,
final String  keyName,
final String  keyValue 
)
inlinestatic

Stops a transaction.

Parameters
nameThe name of the transaction.
keyNameThe key name for extra data.
keyValueThe value of extra data.
static void com.splunk.mint.Mint.xamarinException ( final Exception  exception,
final boolean  handled,
final HashMap< String, Object >  customData 
)
inlinestatic

Used to report exceptions from Xamarin

Parameters
exception
handled
customData

Member Data Documentation

final String com.splunk.mint.Mint.XSplunkMintSessionIdHeader = "X-Splunk-Mint-Session-id"
static

The header name to use for HTTP.

final String com.splunk.mint.Mint.XSplunkMintUuidHeader = "X-Splunk-Mint-uuid"
static

The header name to use for HTTP.


The documentation for this class was generated from the following file: