Splunk MINT SDK for Android

Splunk MINT SDK for Android Developer Guide

Download manual as PDF

Download topic as PDF

Requirements and installation for Android

Requirements

Add the following values to your AndroidManifest.xml file:

  • android:minSdkVersion="15"
  • android:targetSdkVersion="22" or later


For more information, see the <uses-sdk> page on the Android Developers website.

Downloads

The following downloads are available for the Splunk MINT SDK for Android.

Use of the Splunk MINT SDK is subject to the Splunk MINT Terms of Service. You are responsible for complying with privacy laws applicable to your collection of data per the Splunk MINT Terms of Service, which may include notice and consent mechanisms. With version 5.2.2, Splunk MINT Android SDK automatically sends end-user data to Splunk when the end user's device connects to the internet. You can disable this behavior by calling disableAutoFlash before SDK initialization.

Install the SDK plugin using Maven

If you use Apache Maven (version 3.0.5 and later), install the SDK plugin as follows:

  1. Add the following dependency to your pom.xml file:
  2. <dependencies>
    
        <!-- other dependencies here -->
    
        <dependency>
            <groupId>com.splunk.mint</groupId>
            <artifactId>mint</artifactId>
            <version>5.2.4</version>
        </dependency>
    
    </dependencies>
    
  3. Add the repository details to the pom.xml file:
  4. <repositories>
    
        <!-- other repositories here -->
    
        <repository>
            <id>Splunk MINT repo</id>
            <name>The Splunk MINT Repository</name>
            <url>file://<!-- path to the repository -->/mint-plugin-repo-5.2.4</url>
        </repository>
    </repositories>
    

Use the Gradle plugin for Android

You can use the Gradle plugin for Android to integrate with the Splunk MINT SDK.

Requirements:


To use the Gradle plugin for Android:

  1. Download the MINT plugin repository (mint-android-repo-5.2.4.zip), which contains a Maven repository structure, and unzip it into your mobile app project at the app level. We recommend that you do not place the repository in the /libs folder.
  2. Update your your Gradle build file as described below. The build.gradle file is located in the root folder of your project.
  3. Compile and build your project.


For more information about Gradle, see the Gradle Plugin User Guide on the Android Tools Project Site.

Using Gradle without MINT instrumentation

To use the Gradle plugin without MINT instrumentation, add the following MINT dependencies to your app's build.gradle file.


repositories {
    maven {
        url uri('mint-plugin-repo-5.2.4')
    }
    ...
}

dependencies {
    ...    
    compile 'com.splunk:mint-android-sdk:5.2.4'
}

Using Gradle with MINT instrumentation

The Gradle plugin for Splunk MINT supports instrumentation for network calls.

The following types of MINT instrumentation are available:

  • Instrumentation for HttpURLConnection and HttpsURLConnection intercepts HTTP and HTTPS connections.
  • Instrumentation for OkHttp intercepts calls to the OkHttp client.
All types collect the following fields in network events: 
  • signature: The signature of the intercepted network API method (for example, int HttpUrlConnection.getResponseCode()).
  • hashcode: The hashcode of the HTTP connection object, allowing you to differentiate between multiple connections to the same address.
  • threadID: The thread ID.
  • httpMethod: The HTTP method (GET, PUT, POST, or NA).

Add the MINT dependencies to your app's build.gradle file as described below. When you compile and build your project, verify that the MINT transformation task is running.


build.gradle file

apply plugin: 'com.android.application'
apply plugin: 'com.splunk.mint.gradle.android.plugin'

android {
    defaultConfig {
        ...        
        // Use this option when your app targets a version of the Android SDK that is less than 21:
        multiDexEnabled = true  
    }
    ...
}
buildscript {
    repositories {
        maven {
            url uri('mint-plugin-repo-5.2.4')
        }
        // Will need to add jcenter repo OR mavenCentral
        jcenter()
        mavenCentral()
        ...
    }
    dependencies {
        ...
        classpath 'com.splunk:mint-gradle-android-plugin:5.2.4'
     }
}

repositories {
    maven {
        url uri('mint-plugin-repo-5.2.4')
    }
    ...
}

PREVIOUS
MINT Documentation
  NEXT
Add Splunk MINT to your Android project

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


Was this documentation topic helpful?

Enter your email address, and someone from the documentation team will respond to you:

Please provide your comments here. Ask a question or make a suggestion.

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