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

Static Public Member Functions

static void initAndStartSession (final Context context, final String apiKey)
 
static void initAndStartSessionHEC (final Context context, final String url, final String token)
 
static synchronized void startSession (final Context context)
 
static synchronized void closeSession (final Context context)
 
static void flush ()
 
static void setSessionInterval (final int timeInSecs)
 
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, final String key, final String value)
 
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 setApplicationEnvironment (final String environment)
 
static void enableDebugLog ()
 
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 removeExtraData (final String key)
 
static void clearExtraData ()
 
static int getTotalCrashesNum ()
 
static void clearTotalCrashesNum ()
 
static String getLastCrashID ()
 
static void logException (final HashMap< String, Object > customData, final Exception exception)
 
static void logException (final Exception ex)
 
static void logException (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 appEnvironmentRelease = "Release"
 
static final String appEnvironmentStaging = "Staging"
 
static final String appEnvironmentUserAcceptanceTesting = "UserAcceptanceTesting"
 
static final String appEnvironmentTesting = "Testing"
 
static final String appEnvironmentDevelopment = "Development"
 
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.

Member Function Documentation

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

Adds a key-value pair to the extra data.

Parameters
keyThe key.
valueThe value.
static void com.splunk.mint.Mint.addURLToBlackList ( final String  url)
static

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 ( )
static

Clears all extra data.

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

Clears the total number of crashes.

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

Closes the active session.

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

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

static void com.splunk.mint.Mint.enableDebugLog ( )
static

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)
static

Enables LogCat logging.

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

Flushes all saved data.

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

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 ( )
static

Gets the extra data map. Returns a clone of the extra data HashMap

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

Gets the error hash of the last crash.

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

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 ( )
static

Returns the current session ID.

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

Returns the total number of crashes.

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

Use this constructor to initialize and start the session for the MINT Data Collector environment. 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.initAndStartSessionHEC ( final Context  context,
final String  url,
final String  token 
)
static

Use this constructor to initialize and start the session for the HTTP Event Collector (HEC) environment. This constructor validates the HEC token, initializes the plugin environment, installs the exception handler, and sends a PING request.

Parameters
contextThe context of the application.
urlThe URL of the HEC MINT endpoint.
tokenThe token of the HEC input.
static void com.splunk.mint.Mint.leaveBreadcrumb ( final String  breadcrumb)
static

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)
static

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 
)
static

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 
)
static

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 
)
static

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 HashMap< String, Object >  customData,
final Exception  exception 
)
static

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.logException ( final Exception  ex)
static

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.logException ( final String  key,
final String  value,
final Exception  exception 
)
static

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)
static

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,
final String  key,
final String  value 
)
static

Logs a specific view as a Splunk data type.

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

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)
static

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

Parameters
keyThe key to remove.
static void com.splunk.mint.Mint.setApplicationEnvironment ( final String  environment)
static

Sets the application environment. Use a custom string or one of the following suggested environments:

  • appEnvironmentRelease
  • appEnvironmentStaging
  • appEnvironmentUserAcceptanceTesting
  • appEnvironmentTesting
  • appEnvironmentDevelopment
Parameters
environmentThe application environment.
static void com.splunk.mint.Mint.setFlushOnlyOverWiFi ( boolean  enabled)
static

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)
static

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)
static

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 
)
static

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)
static

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.setSessionInterval ( final int  timeInSecs)
static

Sets the session interval time. This value should be more than 30 seconds and less than a day.

Parameters
timeInSecsThe session interval time, in seconds.
static void com.splunk.mint.Mint.setUserIdentifier ( final String  userIdentifier)
static

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)
static

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 synchronized void com.splunk.mint.Mint.startSession ( final Context  context)
static

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 
)
static

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 
)
static

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 
)
static

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)
static

Starts a transaction.

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

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 
)
static

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)
static

Stops a transaction.

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

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 
)
static

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 
)
static

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: