- Print
- DarkLight
- PDF
Welcome to the Webtrends Mobile SDK for Android. The Library provides a way to use Analytics products in your native Android applications. The Analytics SDK features a highly customizable integration that allows you to send data to Webtrends every time a significant event occurs in your mobile application. You can start with our most basic implementation, which captures application events such as starts and stops, with no additional coding.
First, install the SDK, using the instructions below.
Installing the SDK
Download the SDK
Download the Mobile Application Analytics library for Android from the Webtrends Downloads page.
The SDK is packaged into a ZIP file. Once extracted, you will find:
- The compiled SDK (an Android AAR file)
- A README.txt file describing the package
- The Hybrid Guide for the SDK (Webtrends-HybridAppDevelopersGuide.pdf)
- Webtrends-mobile-hybrid-lib.3.0.js (Javascript enabling Analytics features in hybrid apps)
- Webtrends-mobile-lib.3.0.js (Webtrends Mobile Application Library)
- A sample webtrends.xml file
- A sample application that uses the SDK
Import the SDK into Your Project
Once you have an Android project, adding the SDK is simple. These instructions will be based on using Android Studio, but they may easily be adapted for use with Eclipse or any other Android IDE.
- Once the SDK is downloaded and extracted, open up your Android project.
- Select your project root, then choose Project Structure... from the File menu.
- Click the + sign on the top left to add a new module.
- Select Import .JAR/.AAR Package from the list of options and click Next.
- Browse to the extracted
webtrends-sdk-release-xxx-lib.aar
file. This filename will vary from version to version. Click Finish to import. - With your main module (your application) selected, click the Dependencies tab.
- Click the + sign at the bottom to add a Module dependency to your application.
- Select the module that you just imported and click OK.
Add the
webtrends.xml
file to Your ProjectCreate a new
webtrends.xml
file or import the includedwebtrends.xml
file into your project's resources (res/values/) directory. Thewebtrends.xml
file contains required and optional configuration settings. The only required entry in this file iswt_dc_dcsid
(your Analytics DCSID for this application).Open the file for editing and change the following values:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Analytics -->
<string name="wt_dc_dcsid">YOUR_DCSID</string>
</resources>
Your project is now configured to use the Webtrends Mobile SDK.