Installation
Add the Pulse Android SDK to your project and initialize it.
Requirements
- minSdk 21+
- Android Gradle Plugin 8.3.0+
Optional — minSdk below 26 (core library desugaring)
Only if minSdk is below 26. In the app module build.gradle:
android {
compileOptions {
coreLibraryDesugaringEnabled true
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
}
Step 1 — Add Dependency
dependencies {
implementation("org.dreamhorizon:pulse-android-sdk:LATEST_VERSION")
}
Check Maven Central for the latest version.
Step 2 — Initialize
Initialize in your Application class as early as possible in onCreate().
Call initialize() on the main thread. Several instrumentations register listeners on the main thread at startup — deferring or moving initialization to a background thread will cause them to silently not work.
import com.pulse.android.sdk.PulseSDK
import com.pulse.android.api.otel.PulseDataCollectionConsent
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
PulseSDK.INSTANCE.initialize(
application = this,
apiKey = "your-api-key",
dataCollectionState = PulseDataCollectionConsent.ALLOWED,
)
}
}
That's all that's required. With this basic configuration, the SDK starts collecting:
- ✅ Native crashes (uncaught exceptions + JVM crashes)
- ✅ ANR detection
- ✅ Activity and Fragment screen lifecycle
- ✅ App startup timing
- ✅ Slow and frozen frame detection
- ✅ Network connectivity changes (WiFi / cellular transitions)
- ✅ Session tracking
- ✅ Device and OS attributes (
device.model,os.version, etc.)
See Configuration for opt-in instrumentations — including session replay, click tracking, HTTP monitoring, and location.
Step 3 — Verify
if (PulseSDK.INSTANCE.isInitialized()) {
Log.d("Pulse", "SDK initialized successfully")
}
Telemetry will start appearing in your Pulse dashboard within seconds of the first launch.
This covers the basics — but Pulse offers much more through initialize(): instrumentation toggles, session config, consent control, custom headers, disk buffering, and more. See Configuration for the full parameter reference.
Next Steps
- Configuration — Tune instrumentations, consent, global attributes, and more
- Troubleshooting — If something isn't working