Supported on: Android SDK
1.0.33+1. Configure the SDK
Initialize AppDNA as early as possible in your app lifecycle. Place the configuration call in yourApplication.onCreate() method:
Firebase is automatically initialized from
google-services-appdna.json on Android. You do not need to call any Firebase initialization method manually. Ensure that google-services-appdna.json is in your app/ directory and the Google Services plugin is applied (see Installation).If your app already uses Firebase for your own services (Analytics, Crashlytics, Realtime Database), AppDNA automatically creates a separate named Firebase instance. Your existing Firebase setup is not affected.
Configuration Options
TheAppDNAOptions data class lets you customize SDK behavior:
Environment
TheEnvironment enum controls which backend the SDK targets:
Log Level
TheLogLevel enum controls Logcat log verbosity:
Use
LogLevel.DEBUG during development to see all SDK activity in Logcat. Switch to LogLevel.WARNING or LogLevel.NONE for production builds.2. Wait for Ready State
UseonReady to know when the SDK is ready — the bootstrap has succeeded or failed:
onReady does not wait for the remote configuration. When it fires, the SDK serves the cached and bundled config, and the remote fetch may still be running (after a failed bootstrap it starts when a retry succeeds). Use remoteConfig.onChanged to pick up the fetched values.
3. Identify Users
Once a user signs in, callidentify to associate events with their user ID:
Traits are merged with any previously set traits. You do not need to pass all traits on every call — only the ones that have changed.
4. Track Events
Track user actions withtrack:
flushInterval seconds, when the app goes to the background or returns to the foreground, and when the queue reaches a batch size set by the network (100 events on Wi-Fi or a wired connection, metered or not; 20 on a cellular connection the system marks as expensive (iOS) or metered (Android), which is every cellular connection on iOS and most cellular plans on Android; 50 on any other cellular connection). The batchSize option caps it: with a cap, the queue is flushed at the smaller of the two, and no upload sends more.
5. Flush Events Manually
Force an immediate flush of all queued events:6. Set User Consent
Control whether the SDK collects and sends analytics data:7. Change Log Level at Runtime
You can adjust the log level after configuration without restarting the app:"none", "error", "warning", "info", "debug".
8. Remote Config and Feature Flags
Retrieve server-side configuration values:9. Experiments
Get the variant assigned to a user for an experiment:10. Session Data
Store cross-module session data that can be used in template interpolation across onboarding flows, paywalls, and in-app messages:{{session.selected_plan}}.
11. Reset on Logout
When a user signs out, callreset to clear identity-scoped state:
reset() calls. Call AppDNA.flush() separately if you also want to drain the event queue before logout.
You now have the SDK configured, user identification, event tracking, remote config, experiments, and session data working. Continue to the module-specific guides for Push Notifications, Billing, Onboarding, and Paywalls.

