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

AppDNA.features.onChanged is not yet wired on Android. The callback is accepted and stored, but the underlying change listener is a stub that never fires, so your callback will not be invoked when the remote config updates. Do not rely on it to react to live config changes on Android today. Instead, re-read flags with isEnabled / getVariant at the points where you need current values (for example, on app foreground or screen entry).
The intended usage — once wired — is to register a callback that reacts when flags change after a live config update:
When wired, the callback receives the full Map<String, Boolean> snapshot — not just changed keys. Re-read whichever flags you care about and react accordingly.

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 on the next SDK config refresh (within the TTL window, default 1 hour) or immediately via the live Firestore listener.

Next Steps