Mobile RUM - Android SDK
Android RUM - Setup & Installation Docs | Middleware
The Mobile RUM SDK provides a customizable suite of tools to analyze and optimize the performance of Android applications. Isolate ANR and network changes, quickly detect application crashes, identify slow or frozen frames and more.
Prerequisites
Android SDK Version 21
or above. Check your Android SDK version with the following command:
Install & Instrument Your Android Application
Step 1: Install Middleware Android SDK
Step 2: Add Application Instrumentation Config
Step 2a: Configuration Methods [Optional]
Understand the behavior of your RUM Android application with the following methods and set particular attributes related to telemetry ingestion, monitoring, and instrumentation.
Method | Description |
---|---|
setRumAccessToken(String) | Authorizes client to send telemetry to Middleware |
setTarget(String) | Sets target URL to recieve telemetry |
setService(String) | Sets service name of your application |
setDeploymentEnvironment(String) | Sets environment attribute on spans generated by instrumentation. Example: PROD , DEV |
disableCrashReporting() | Disables crash reporting which is enabled by default |
disableAnrDetection() | Disables Application Not Responding (ANR) detection which is enabled by default |
disableNetworkMonitor() | Disables network change detection which is enabled by default |
disableSlowRenderingDetection() | Disables slow or frozen frame render detection which is enabled by default |
setSlowRenderingDetectionPollInterval(Duration) | Sets default polling for slow or frozen render detection. Default detection interval is 1000 milliseconds |
Step 3: HTTP Instrumentation Config [Optional]
Integrate with OkHTTP3 to monitor HTTP events across user devices.
Custom Configurations
Set Global Attributes
Global attributes serve as metadata or contextual information that can be attached to telemetry, traces, or logs collected by the instrumentation framework or SDK. They are key-value pairs that provide additional details about the application, device, user session, or environment.
Set the following Global Attributes to instrument your application:
Events
Step 1: Setup Your Custom Event
Send custom events and workflows using addEvent
Step 2: Start Custom Event Workflow
Start custom events and workflows using startWorkflow
Step 3: End Custom Event Workflow
End custom events and workflows using end
Error Reporting
Use addException(Throwable)
to report exceptions, errors, and display messages on the Middleware dashboard
Logs
Add custom logs to display on your Middleware dashboard such as debug, error, warning, and info
Session Replay
Control how you capture and replay your users’ browsing experience. To start and stop session replay, override the onResume
and onPause
methods.
Android Version 8.0 (Android Oreo)
or higher Session Recording
The maximum session recording duration is four hours. If users are inactive for more than 15 minutes at a time, session recordings will be stopped. If users exceed more than four hours in a single session or become active again after the 15-minute inactivity timeout, a new session will be automatically created.
Session recording is enabled by default. Disable this feature with the following function:
Privacy
Blur sensitive information in session recordings by embedding the following method:
Default Attributes
The following Attributes are provided by the Android SDK by default:
Name | Type | Description |
---|---|---|
project.name , app | String | Defines the project name, used as projectName(String) |
service.name | String | Defines the service name, used as serviceName(String) |
session.id | String | Random session identifier generated by Middleware SDK |
rum.sdk.version | String | Middleware SDK version |
Resource Attributes
The following Resource Attributes are applied to all spans by default:
Name | Type | Description |
---|---|---|
deployment.environment | String | Name of deployment environment. Example: DEV , PROD |
device.model.identifier | String | Device model identifier. Example: Moto-G30 |
device.model.name | String | Name of device. Example: ONEPLUS A600 |
device.manufacturer | String | Name of device manufacturer. Example: OnePlus |
os.name | String | Name of operating system. Sets to Android |
os.description | String | Operating System description. Example: Android Version 11 (Build RKQ1.201217.002 API level 30) |
os.type | String | Operating System type. Sets to Linux |
os.version | String | Operating System version. Example: Android version 11 |
Instrumentation Attributes
The following Instrumentation Attributes are additional properties the Android SDK provides: