With the Tealeaf Android SDK, you instrument your native and hybrid Android applications for logging and analysis. It captures device context and user activity, so you can monitor and evaluate the performance of your applications.
The Android SDK was designed for simple implementation: it uses standard Android classes and user interface controls to track user interface events and minimizes the impact on your application's performance. Even without the framework, Tealeaf can monitor the traffic between your application and your server. With the framework, you get unprecedented insight into the performance of your application.
To develop Android applications with the Android SDK, follow these system and software requirements:
API level 16 to 30 Supports Android
- API level 16 to 30
- Supports Android Studio 4.0, Gradle 6.1.1, and Kotlin 1.3.72
- Sample configuration in gradle file: build.gradle android
android{
compileSdkVersion30buildToolsVersion‘30.0.0’defaultConfig{
applicationId‘com.tl.uic.appDarkHoloAuto’minSdkVersion16targetSdkVersion30versionCode1versionName‘1.0’
}
- Consult the Google Android Dev Center for the latest Android technical documentation and tools.
- Tealeaf client frameworks do not support forwarding of application data to third-party systems. Application data must be forwarded to the server that hosts the native application.
- Tealeaf has passed all Apple Store and Google Play Store regulations. If you encounter an issue with the Tealeaf library that is related to required scanning for Apple Store and Google Play Store, you can work directly with your Tealeaf services representative to resolve the issue.
- Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
- Mac OS X 10.5.8 or later (x86 only)
- Linux (tested on Ubuntu Linux, Lucid Lynx)
- GNU C Library (glibc) 2.7 or later is required
- On Ubuntu Linux, version 8.04 or later is required
- 64-bit distributions must be able to run 32-bit applications. For more information about how to add support for 32-bit applications, see the Ubuntu Linux installation notes.
The SDK can be integrated with Android apps developed with the following frameworks.
You can download the Android package by following the SDK download instructions at Download the UIC iOS, and Android SDKs. The package contains seven folders created for the Tealeaf Android release.
AndroidImageCaptureTool
folder - Tool used to collect embedded images for Native Replay.EOCore
folder - Contains base jar and aar library needed for Tealeaf and Digital Anayltics to communicate to server.TealeafMod
folder - Contains jar and aar library that will collect Tealeaf data that passed to EOCore.TeaCuts
folder - Contains jar library that will help auto-instrument Tealeaf into an Android applicationTealeafInstaller
folder - Contains the ruby rake installer for Android Studio projects. It will add the library to the Android application in seconds with base defaults.AndroidStudioMD5
folder - SDK built in with SHA256 image hashing. Import this library to enable MD5 image hashing.AndroidStudioSHA512
folder - SDK built in with SHA256 image hashing. Import this library to enable SHA512 image hashing.
Other folders you may find useful when using the Tealeaf Android SDK are found here:https://github.com/ibm-watson-cxa.
- SampleCode folder - Contains several sample applications that demonstrate how to integrate and use the library. It can be found at https://github.com/ibm-watson-cxa. It is recommended that you use SDK auto-instrumentation for your app.
- Auto instrumentation sample apps:
Hybrid app - SampleCode_Tealeaf_HybridHtmlEmbeddedAuto
Android native app - SampleCode_Tealeaf_Android_DarkHoloAuto - Manual instrumentation sample apps:
Hybrid app - SampleCode_Tealeaf_HybridHtmlEmbeddedManual
Android native app - SampleCode_Tealeaf_Android_DarkHoloManual
- Auto instrumentation sample apps:
- KillSwitch folder - Contains a basic kill switch implementation for JSP, ASP.Net, and PHP servers. It can be found at https://github.com/ibm-watson-cxa/SDK_Tools/tree/master/KillSwitch.
- TealeafTargetSimulator folder - Contains the tool used to convert sessions into images that are used for Native Replay. It can be found at https://github.com/ibm-watson-cxa/SDK_Tools/tree/master/TealeafTargetSimulator.
- Templates folder - Contains the latest native templates compatible with the library. It can be found at https://github.com/ibm-watson-cxa/SDK_Tools/tree/master/NativeTemplates.
In benchmark tests, the Android SDK has the following effects on resources of the visitor's device:
- 2 to 3% more memory consumption
Note:
If the server is unreachable, the SDK saves data to memory until the server is reachable. By default, the SDK will store up to 512,000 bytes to the device memory. If the cache grows larger than 512,000 bytes, the oldest data is truncated from cache and is deleted. The cache size is managed through the CachedFileMaxBytesSize
setting in EOCoreAdvancedConfig.json,
.
- Minimal effect on battery life
The framework automatically handles environmental data that is captured when the framework initializes, typically when your application starts, and at regular time intervals during execution. It also provides support for your application to report environmental data that needs special privacy attention or requires special frameworks.
Environmental data can be distributed among multiple hits.
- Data that is captured when the framework initializes generally appears in one of the first hits of a session.
- Data that is captured at regular time intervals appears along with events. Multiple values can be submitted in a single hit where the number of events is low.
- Data that is captured by your application (location and carrier information) can appear at any time, independently or in hits with the other types of environmental data. Multiple values for a single hit can be submitted if your application makes multiple calls to the framework.
Captured at initialization
These values are captured one time per launch of your application when the framework initializes.
Environment data is collected based on a timer. Environment data related to initialization can be, but is not always, submitted on the first hit of the session. As environment data is passed through the framework, it is prioritized based on its logging level. The order that it is posted to the server and even whether it is posted to the server depends on the following.
- Budgets for in-memory and local storage caches
- Network packet size
- The send level for the type of network available to the application
Note:
Data is not posted to the server in the order that it was captured.
pixelDensity
Value that is returned by [[UIScreen mainScreen] scale]
deviceWidth
Value that is returned by [[UIScreen mainScreen] bounds].size.width
.
deviceHeight
Value that is returned by [[UIScreen mainScreen] bounds].size.height
.
width
Value that is returned by pixelDensity*deviceWidth
.
height
Value that is returned by pixelDensity*deviceHeight
.
osVersion
Version of Android running on the device.
totalStorage
Total storage on the device, free+used
.
totalMemory
Total memory of the device, free+used
.
manufacturer
The manufacturer of the product/hardware.
userID
Unique user ID generated by the Android SDK for the current instance of the application.
appVersion
Version of the Android application.
deviceModel
Type of device.
appName
Name of the current application.
orientationType
The orientation of the device (PORTRAIT, LANDSCAPE, FLAT, or UNKNOWN).
locale
Current locale (for example, en).
language
Current language (for example, English).
osType
The type of device used during capture.
tag
All the controls on which you would like to create events must have unique ids. For example, if there is a text field for Total
of prices of all the items in the cart, and on server you want to create an event for Total > 300
, you should to assign unique ids to the text filed control. This can be done by setting the tag property of the UIView
.
Captured during execution
These values are captured at a regular time interval you can set for each logging level with TimeBetweenSnapshots
in TLFLevelsConfiguration.plist
.
freeMemory
The memory that is remaining.
freeStorage
The storage that is remaining.
battery
The value that is returned by ( [UIDevice currentDevice].batteryLevel ) * 100
.
carrier
The current network carrier.
networkReachability
The network status (Unknown
, NotReachable
, ReachableViaWiFi
, or ReachableViaWWAN
).
ip
The IP address of the device.
orientation
0 if [[UIDevice currentDevice] orientation]
returns UIDeviceOrientationPortrait
, UIDeviceOrientationFaceDown
, or UIDeviceOrientationFaceUp
.
90 if UIDeviceOrientationLandscapeRight
.
180 if UIDeviceOrientationPortraitUpsideDown
.
270 if UIDeviceOrientationLandscapeLeft
.
Apply the following tips to your application development and integration of the Acoustic Tealeaf Android SDK:
- Use the kill switch to control logging of the Android application
- Add IDs for all UI controls that you want to capture
- Apply privacy masking or blocking of all sensitive customer data through the Android SDK
- Due to the way JSON messages are captured and transmitted, force a submission of all queued messages before you allow users of your mobile native application to open a web view. If this step is not done, hits can appear to be out of order during replay in Acoustic Tealeaf.
- When enabling the Tealeaf library for supported Android OS API levels, follow this best practice:
if(Build.VERSION.SDK_INT>=16&&Build.VERSION.SDK_INT<=30){
Tealeaftealeaf=newTealeaf(this.getApplication());Tealeaf.enable();
}
- Getting started with Customer Experience Analytics, Tealeaf SDK for Android
- Implementing the SDK for Android development in your application
- Quick start server configuration for Android
- Instrumenting a Cordova Android application
- Instrumenting an Ionic-2 Android application
- Capturing and uploading images for application replay with the Android Image Capture tool
- Using the Target Simulator for application replay with Android
Note:
The Target Simulator is not expected to be used in most scenarios. It should only be used when the Android Image Capture Tool is unable to support your image replay experience. For example, to capture all MD5s.
Other related documentation for Customer Experience Analytics, Experience Analytics (Tealeaf), and Digital Analytics
iOS SDK overview: Acoustic Experience Analytics (Tealeaf) SDK for iOS, standard and mobile editions UIC SDK overview: Tealeaf UI Capture Android SDK overview: The Digital Analytics SDK for Android. iOS SDK overview:The Digital Analytics SDK for iOS
Updated 2 months ago