Splunk MINT SDK for Android (Legacy)

Splunk MINT SDK for Android Developer Guide

Acrobat logo Download manual as PDF


Splunk MINT is no longer available for purchase as of January 29, 2021. Customers who have already been paying to ingest and process MINT data in Splunk Enterprise will continue to receive support until December 31, 2021, which is End of Life for all MINT products: App, Web Service (Management Console), SDK and Add-On.
Acrobat logo Download topic as PDF

Integrate WebView monitoring

WebView monitoring allows the MINT SDKs to access hybrid (non-native) web pages and gain visibility into their functions.

Integrate WebView monitoring

Use one of the following ways to integrate WebView monitoring into your application to view Web pages:

  • Use MintWebView
  • This option is the easiest way to integrate WebView monitoring into your application.

    1. In the XML file that contains your WebView, replace <WebView/> with <com.splunk.mint.MintWebView.
    2. In your activity, add the following code:
    3. MintWebView webView = (MintWebView) findViewById(R.id.webview);
      
  • Extend MintWebView
  • This option lets you use your own instance of WebView.

    webView = (MintWebView) findViewById(R.id.webview);
    webView.getSettings().setJavaScriptEnabled(true);
    MintJavascript mintJavascript = new MintJavascript(this, webView);
    webView.addJavascriptInterface(mintJavascript, "mintBridge");
    webView.setWebViewClient(new MintWebViewClient());
    
  • Use your own WebView client
  • To use your own WebViewClient, replace the last line of the previous example with the following code:

    webView.addJavascriptInterface(mintJavascript, "mintBridge");
    webView.setWebViewClient(new MintWebViewClient());
    
    webView.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            super.onPageStarted(view, url, favicon);
            view.loadUrl(MintJavascript.loadMintJavascript());
        } 
    });
    


Hybrid API calls

You can use the following hybrid API calls.

Mint.initAndStartSession('apiKey')
Mint.startSession()
Mint.closeSession()
Mint.flush()
Mint.addExtraData('key', 'value')
Mint.clearExtraData()
Mint.leaveBreadcrumb('breadcrumb1')
Mint.logEvent('event name', {'key': 'value'})
Mint.logView('view name', {'key': 'value'} )
Mint.setLocation('myLatitude', 'myLongitude', 'myLocationTimestamp')
Mint.setUserIdentifier('username')
Mint.transactionCancel('transaction id', 'reason for cancel', {'key': 'value'})
Mint.transactionStart('transaction name', {'key': 'value'})
Mint.transactionStop('transaction id', {'key': 'value'})
Last modified on 28 January, 2019
PREVIOUS
View memory trim notifications
  NEXT
Generate network events with an OkHTTP Interceptor

This documentation applies to the following versions of Splunk MINT SDK for Android (Legacy): 5.2.x


Was this documentation topic helpful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters