Supported on: Android SDK
1.0.33+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 withgetVariant:
Any? (string, number, boolean, list, or map). Cast to the type the Console stored.
Module Access
Module Methods
| Method | Signature | Description |
|---|---|---|
isEnabled | isEnabled(flag: String): Boolean | Check if a feature flag is enabled |
getVariant | getVariant(flag: String): Any? | Get the typed value for a flag (string/number/bool/map) |
onChanged | onChanged(callback: (Map<String, Boolean>) -> Unit) | Register a callback for flag changes |
Listen for Changes
Register a callback to react when flags change after a live config update: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
- Combine with Experiments for A/B-tested rollouts
- Use Remote Config for richer value shapes
- Configure Offline Support for cache TTL behavior

