mobile SDK
Android feature flags
The Android SDK is a Kotlin client. It fetches values already evaluated for one user. It does not download your rules. minSdk 21, Java 17, Kotlin 1.9+. The current version is 0.2.0. Ship a client key (sdk-js-env-…), never a server key. It is MIT licensed.
Android docsGitHubio.featureflow:featureflow-android-sdk
Set it up with your coding agent
Paste this into Claude Code, Cursor or any coding agent. It installs the Android SDK, creates the client and evaluates your first flag.
Set up Featureflow with the Android SDK in this project. Run `npx skills add featureflow/featureflow-skills --skill featureflow-setup -y` first, then follow the skill. Keep SDK keys in env vars.
Or set it up by hand
Install
dependencies {
implementation("io.featureflow:featureflow-android-sdk:0.2.0")
}Initialise
val user = FeatureflowUser.Builder("user-123")
.withAttribute("tier", "gold")
.withAttributes("roles", listOf("beta"))
.build()
val featureflow = FeatureflowClient.initialize(
context = applicationContext,
apiKey = "sdk-js-env-YOUR_KEY",
user = user
)Evaluate a flag
if (featureflow.evaluate("new-checkout").isOn()) {
// the new checkout
} else {
// the old one
}Kill switch
Branch on evaluate("new-checkout").isOn(). FeatureflowConfig.defaultVariants is what you serve before the first fetch and when offline. Anything unlisted is off. initialize is a suspend function and never throws. Pass an application context. Create one client, usually from Application.onCreate.
The operational side is the kill switch. Turning the flag off does not require a redeploy.
Gradual rollout
Percentage rollouts bucket on the user id. The docs say not to use the Android ID or an advertising ID, because they change on reset and reinstall. Omit the user and the SDK generates an anonymous id and persists it. A shipped APK keeps evaluating flags for as long as people run that build, so archive a flag instead of deleting it while old versions are installed.
See progressive rollout for the dashboard control. Release pipelines and approval workflows, if the change itself needs a review, are on the Business plan at $399 a month. That price is on the pricing page.
Targeting
FeatureflowUser.Builder.withAttribute and withAttributes attach the values dashboard rules match. updateUser is suspend and re-evaluates. In Kotlin, the variant check is evaluation.`is`("wizard") because is is a keyword. From Java it is evaluation.is("wizard"). jsonValue() returns null when the variant has no JSON. track("purchase", value = 49.95) records a goal.
Frequently asked questions
What is the Gradle dependency?
implementation("io.featureflow:featureflow-android-sdk:0.2.0"). The repository is github.com/featureflow/featureflow-android-sdk. The SDK declares the INTERNET permission itself.
Which key goes in the APK?
A client key starting with sdk-js-env-. The docs say a server key downloads the ruleset and can be extracted from a shipped APK. Rotate it if it has been shipped.
How do Compose UIs read a flag?
features is a StateFlow of flag key to variant. Reading the flow records no impression. Call evaluate() at the point the user is actually exposed. Until isReady, a missing key means not ready yet, not off.