Flashduty Android RUM SDK supports Android 6.0 (API level 23) and above.
By integrating the SDK, you can monitor your Android app’s performance,
errors, and user behavior in real-time.
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.Integration Steps
Get Application Credentials
In the Flashduty console’s RUM Application Management page:
- Create or select an Android application
- Get the following credentials:
- Application ID - Application unique identifier
- Client Token - Client access token
Initialize SDK
Initialize Flashcat SDK in your
Application class’s onCreate() method:Application.kt
Parameter Description:
environmentName- Environment name (e.g., production, staging)appVariantName- App variant name, used to distinguish data from different build versions- For more configuration options, see Advanced Configuration
Enable RUM Features
Configure and enable Android SDK’s RUM features:
Application.kt
The SDK will automatically start collecting the following data:
- User interaction events
- Long task monitoring
- Activity view tracking
Configure Network Tracking (Optional)
Configure network interceptors to track HTTP requests and responses:Add OkHttp dependency:Configure interceptor:Track Network Redirects or Retries:To monitor network redirects or retries, use Filter Specific Errors:To filter specific errors reported by
build.gradle
With
DatadogInterceptor, every request handled by OkHttpClient is
automatically recorded as a resource, with relevant information (URL, method,
status code, error) automatically populated.- Only network requests initiated while a view is active are tracked - To
track requests when app is in background, see Track Background
Events - If using multiple interceptors, add
DatadogInterceptoras the first interceptor
DatadogInterceptor as a network interceptor:DatadogInterceptor, configure a custom EventMapper in RumConfiguration:Advanced Configuration
Track Background Events
You can track events when the app is running in the background (e.g., crashes and network requests):Offline Data Handling
The Android SDK ensures data availability when the user’s device is offline:Data Persistence Mechanism: - Events are stored locally in batches when
network signal is weak or device battery is low - Automatically uploaded when
network recovers, ensuring no data loss - Old data is automatically cleaned up
to avoid excessive disk usage
Even if users use the app while offline, data is retained and uploaded when
network recovers, ensuring no monitoring data is lost.
Track Local Resource Access
You can track access to assets and raw resources:- Assets Resources
- Raw Resources
WebView Integration
If your Android app contains WebViews, you can enable WebView tracking to monitor web content performance and errors.Web pages in WebView can now be correlated with native app RUM data.
Verify Integration
After integration, verify that the integration is successful:Access Console
Log in to Flashduty console, go to the corresponding RUM application, and check if data is being reported.
Trigger Test Events
Perform the following actions in the app to verify data collection: - Open
different pages in the app to verify page view events - Perform user actions
(clicks, swipes, etc.) to verify interaction events - Trigger network requests
to verify resource loading events
ProGuard Configuration
If your app has code obfuscation enabled (ProGuard/R8), add the following rules to yourproguard-rules.pro file:
proguard-rules.pro
Next Steps
Advanced Configuration
Configure advanced SDK features like custom sampling, user identification, global context, etc.
Data Collection
Learn about data types and data structures collected by the SDK
Insights
View and analyze app performance, errors, and user behavior data
Error Tracking
Configure crash reporting and error tracking features