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. |
- Java package file (mint-5.2.5.jar) to add to your project build path.
- splunk-mint-5.2.5.zip file that includes the JAR file and the documentation.
- MINT plugin repository for Gradle (mint-android-repo-5.2.5.zip). For details, see Use the Gradle plugin for Android.
- md5 checksum file to verify the download.
Install the SDK plugin using Maven
If you use Apache Maven (version 3.0.5 and later), install the SDK plugin as follows:
- Add the following dependency to your pom.xml file:
- Add the repository details to the pom.xml file:
<dependencies> <!-- other dependencies here --> <dependency> <groupId>com.splunk</groupId> <artifactId>mint-android-sdk</artifactId> <version>5.2.5</version> </dependency> </dependencies>
<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.5</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:
- Android Studio version 2.3.2 or later.
- To use Gradle with MINT instrumentation, Android plugin for Gradle version 2.3.2 or later.
To use the Gradle plugin for Android:
- Download the MINT plugin repository (mint-android-repo-5.2.5.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.
- Update your your Gradle build file as described below. The build.gradle file is located in the root folder of your project.
- Compile and build your project.
For more information about Gradle, see the Gradle Plugin User Guide on the Android Tools Project Site.
Use the Android SDK 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.5') } ... } dependencies { ... compile 'com.splunk:mint-android-sdk:5.2.5' }
Use the Android SDK 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.5') } // Will need to add jcenter repo OR mavenCentral jcenter() mavenCentral() ... } dependencies { ... classpath 'com.splunk:mint-gradle-android-plugin:5.2.5' } } repositories { maven { url uri('mint-plugin-repo-5.2.5') } ... }
MINT Documentation | Add Splunk MINT to your Android project |
This documentation applies to the following versions of Splunk MINT™ SDK for Android (Legacy): 5.2.x
Feedback submitted, thanks!