Android (Kotlin) SDK: Modern Analytics for Android

A modern, native Kotlin SDK for Android with coroutine-based concurrency, plugin architecture, and 4x faster event processing.
Available Plans
  • free
  • starter
  • growth
  • enterprise

We’re pleased to announce the new Android (Kotlin) SDK for faster and efficient event tracking on your Android apps. It delivers up to 4x faster event processing with a modern, extensible architecture. Built with Kotlin coroutines and a plugin-based design, it provides type safety and cleaner payloads.

announcement
RudderStack recommends using the Android (Kotlin) SDK for all new Android implementations. The legacy Android (Java) SDK will continue to receive maintenance updates but no new features.

Why we built this

The legacy Android SDK served customers well, but modern Android development has evolved significantly. Developers now expect coroutine-based async handling, type-safe APIs, and modular architectures that integrate cleanly with Jetpack libraries.

The legacy SDK’s architecture made it difficult to add new capabilities without increasing complexity. Customers who wanted to customize event payloads or add custom processing logic had to wait for SDK team updates, thereby creating bottlenecks and slowing their implementation timelines.

The Android (Kotlin) SDK addresses these limitations with a ground-up redesign that embraces modern Android practices and gives you the extensibility to customize your implementation without waiting for SDK changes.

Key benefits

This section lists some key benefits of using the Android (Kotlin) SDK.

Performance

  • 4x faster event processing: Optimized batching and burst handling dramatically improve event delivery speed to the data plane server

Developer experience

  • Coroutine-based async: Structured concurrency with proper lifecycle management replaces manual thread handling
  • Type safety: Compile-time safety with Kotlin’s type system catches errors before runtime
  • NavController integration: Automatic screen tracking with Android Navigation Component, including Compose support

Extensibility

  • Plugin architecture: Modular design lets you add custom plugins to modify, enrich, or process events without waiting for SDK updates
  • Multi-instance support: Run multiple SDK instances with different write keys in the same application

Maintainability

  • Cleaner payloads: Reduced redundancy by removing duplicate fields like context.traits.anonymousId, resulting in smaller and more consistent event data

How to use the SDK

For installation, initialization, and API usage, see the Android (Kotlin) SDK Quickstart. For configuration options, see SDK Configuration Options.

New and improved features

New features

See the New Features in Android (Kotlin) SDK guide for more information.

Improvements over legacy SDK

  • Configuration: Replace RudderConfig.Builder() chains with a direct Configuration(...) constructor
  • Properties: Use buildJsonObject { } for compile-time type safety instead of RudderProperty().putValue() with runtime checks
  • Async handling: Native coroutine integration replaces manual thread management
  • Plugin management: Add and remove plugins dynamically at runtime with add() / remove()

A sample SDK configuration is shown below:

// Kotlin SDK - cleaner, no builder pattern
val config = Configuration(
    writeKey = "WRITE_KEY",
    application = application,
    dataPlaneUrl = "DATA_PLANE_URL",
    logLevel = LogLevel.DEBUG
)

An example of type-safe properties is shown below:

val properties = buildJsonObject {
    put("product_id", "12345")
    put("price", 99.99)
}

See the following guides for more information:

Migrate from legacy Android SDK

success
The legacy Android (Java) SDK continues to work and receive maintenance updates, so you can migrate at your own pace.

The Android (Kotlin) SDK introduces API and payload changes from the legacy Android (Java) SDK. Event payloads remove redundant fields (for example, context.traits.anonymousId, context.traits.userId, context.userAgent) and the library identifier in payloads changes to com.rudderstack.sdk.kotlin.android.

warning
If your downstream systems rely on these removed fields, make sure to update your transformations before migrating.

See the following guides for detailed API differences and migration process:

SDK versions

SDKLatest version
Android (Kotlin) SDK1.2.0

Platform requirements

PlatformMinimum version
Android API21+ (Lollipop)
Kotlin1.7.0+
Java8+

Resources

See the following resources for learning more about the Android (Kotlin) SDK:

The following guides will help you get started with the Android (Kotlin) SDK:

Questions? We're here to help.

Join the RudderStack Slack community or email us for support