We've built a simple mobile application written in Kotlin that demonstrates how LaunchDarkly's SDK works.
Below, you'll find the build procedure. For more comprehensive instructions, you can visit your Quickstart page or the Android reference guide.
- Make sure you have Android Studio installed.
- Edit
MainApplication.kt
andMainActivity.kt
in thesrc/main/java/com/launchdarkly/hello_android
directory and set the value of LAUNCHDARKLY_MOBILE_KEY to your LaunchDarkly mobile key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, set BOOLEAN_FLAG_KEY to the flag key.
val LAUNCHDARKLY_MOBILE_KEY = "mobile-key-from-launch-darkly-website"
val BOOLEAN_FLAG_KEY = "my-boolean-flag"
- Run your application through the Emulator or on a real device.
You should see the message "The feature flag evaluates to .". The application will run continuously and react to the flag changes in LaunchDarkly.
You can find an example mobile application written in Java in this GitHub repository.