Skip to main content
Supported on: Android SDK 1.0.33+
The feature flags module lets you enable or disable features remotely from the AppDNA Console. Flags are evaluated locally from cached config — no network call, no latency.

Check a Flag

isEnabled() returns false by default if the flag does not exist or config has not loaded. The top-level convenience method AppDNA.isFeatureEnabled("dark_mode") is equivalent.

Read a Variant Value

Some flags carry a typed payload beyond on/off (e.g., a tier name or rollout percentage). Read the value with getVariant:
Returns Any? (string, number, boolean, list, or map). Cast to the type the Console stored.

Module Access

Module Methods

Listen for Changes

Register a callback that receives every flag’s current isEnabled value each time the SDK applies feature-flag or in-app-message configuration fetched from the server — at configure(), on each scheduled refresh (the config TTL and the background refresh worker), and on AppDNA.remoteConfig.refresh(). It fires after every such fetch even when no flag changed, and usually more than once per fetch (once for each flag or message document the SDK reads, and once when it prunes removed ones), so compare with the values you last acted on:
The callback receives every flag, each with its isEnabled value, as a Map<String, Boolean> — not just changed keys. Re-read whichever flags you care about and react accordingly. Callbacks add up: each one you register fires. You can register before configure, and a callback stays registered after shutdown() and fires again once configure runs.

Using Flags with Experiments

Feature flags and experiments work together. Gate a feature behind a flag, then run an experiment to test its impact:

Full Example

Feature flags are managed in the Console under Settings → Feature Flags. Toggle a flag on or off and it takes effect at the next SDK config fetch — when the TTL elapses (default 1 hour), at the background refresh every 15 minutes, or at AppDNA.remoteConfig.refresh() / AppDNA.forceRefreshConfig(). The SDK does not listen for flag changes in real time.

Next Steps