Experimentation Lab
Interactive implementation reference
Feature SDK implementation

Android

Native Android feature delivery with lifecycle-aware configuration updates.

Android · Kotlin
This runtime cannot execute inside a Next.js browser process. The page shows the native, official SDK shape; use the JavaScript, React, or Next.js pages for a live decision and event round trip with the same project, flag, event, and visitor ID.

Implementation

Official docs ↗
implementation("com.optimizely.ab:android-sdk:VERSION")
val client = OptimizelyManager.builder().withSDKKey(sdkKey).build(context)
client.initialize(context) { optimizely, _ ->
  val user = optimizely.createUserContext("visitor-123")
  val decision = user.decide("demo_flag")
  user.trackEvent("demo_purchase")
}