About Dependencies and Package NamesFlashduty Android SDK is fully compatible with the Datadog open-source protocol. In
build.gradle, use cloud.flashcat group for dependencies, but in Kotlin/Java code, import classes from the com.datadog.android package. You can seamlessly leverage Datadog ecosystem documentation, examples, and best practices while enjoying Flashduty platform services.Supported Configuration Scenarios:
- Enrich user sessions - Add custom views, actions, resources, and error information
- Protect sensitive data - Mask personally identifiable information and sensitive data
- Associate user sessions - Link user sessions with internal user identifiers
- Control data volume - Optimize data collection through sampling and event filtering
- Enhance context - Add custom attributes to data
Enrich User Sessions
Custom Views
When usingActivityViewTrackingStrategy or FragmentViewTrackingStrategy, the RUM SDK automatically tracks views. You can also manually send custom RUM views when a view becomes visible or interactive.
- Kotlin
- Java
Parameter Description:
viewKey(String) - Unique identifier for the view, sameviewKeyused forstartView()andstopView()viewName(String) - Name of the viewattributes(Map<String, Any?>) - Attributes attached to the view (optional)
Custom Actions
In addition to auto-tracked user interactions, you can track specific custom user actions (like clicks, swipes, likes).- Kotlin
- Java
RumActionType Enum Values
RumActionType Enum Values
| Type | Description | Use Case |
|---|---|---|
RumActionType.TAP | Tap action | Button, icon taps |
RumActionType.SCROLL | Scroll action | List, page scrolling |
RumActionType.SWIPE | Swipe action | Swipe transitions, gestures |
RumActionType.CLICK | Click action | General clicks |
RumActionType.CUSTOM | Custom action | Business-specific actions |
Custom Resources
In addition to auto-tracked resources, you can manually track specific custom resources (like network requests, third-party library loading).- Kotlin
- Java
RumResourceKind Resource Types
RumResourceKind Resource Types
| Type | Description | Use Case |
|---|---|---|
BEACON | Beacon request | Analytics reporting |
FETCH | Fetch request | Modern async requests |
XHR | XHR request | Traditional Ajax |
DOCUMENT | Document resource | HTML documents |
IMAGE | Image resource | Image loading |
JS | JavaScript resource | JS files |
FONT | Font resource | Font files |
CSS | CSS resource | Style files |
MEDIA | Media resource | Audio/video files |
NATIVE | Native resource | Native module loading |
OTHER | Other resource | Uncategorized resources |
Custom Errors
To record specific errors, notify the RUM SDK when an exception occurs:- Kotlin
- Java
For more error reporting details, see Android Error Reporting.
Custom Timing
In addition to RUM SDK’s default performance metrics, you can use theaddTiming API to measure the duration of key operations. Timing is an offset relative to the current RUM view start time.
- Kotlin
- Java
Add User Attributes
The RUM SDK automatically tracks user attributes. You can also add additional custom user attributes like user plan, user group, etc.- Kotlin
- Java
Event and Data Management
Clear All Data
UseclearAllData to clear all unsent data currently stored in the SDK:
- Kotlin
- Java
Sampling
You can control the percentage of sessions that collect RUM data:User Tracking Consent
To comply with privacy regulations like GDPR and CCPA, you can set user tracking consent state:| State | Behavior |
|---|---|
GRANTED | Start collecting data and send to Flashduty |
NOT_GRANTED | Do not collect any data |
PENDING | Collect but do not send, wait for user decision |
Global Context
Add global context attributes that will be attached to all RUM events:- Kotlin
- Java