Manage Android Flags with Ease

Reduce risk, iterate quicker, and get more control with LaunchDarkly
Android feature flag management. Try it out free with a 30-day trial.

Try It Free
Feature flag lifecycle management
Feature flag lifecycle management
Manage feature flags across multiple dev environments with flag statuses, audit logging, and custom roles
Feature toggle user and performance feedback
Get feedback without a full release
Release to limited user segments, test your infrastructure, and get the feedback you need to iterate quickly
Feature flags kill switch and feature toggles
Kill bad features without redeploying
Reduce risk and unlock the power of continuous delivery

Mobile Android Feature Flags

Let's create a mobile Android feature flag for a "One Click Checkout"

1.In your build.gradle file, declare a dependency on the LaunchDarkly Android SDK:

Check out our open source mobile Android SDK on GitHub or read through the reference documentation.

               
       compile 'com.launchdarkly:launchdarkly-android-client:#.#.#'
                
              

2.Use the builder pattern to construct a user object:

You can pass us any data about users for targeting and segmentation.

               
          user = new LDUser.Builder("aa0ceb")
           .email("fake@example.com")
           .firstName("Jake")
           .lastName("Fake")
           .custom("group", "microsoft")
           .build();
                
              

3.Create a config object, then initialize the shared instance of LDClient

               
          LDConfig ldConfig = new LDConfig.Builder()
              .setMobileKey("YOUR_MOBILE_KEY")
              .build();

          LDClient ldClient = LDClient.init(this.getApplication(), ldConfig, user, 5);
                
              

4.Create a feature flag in LaunchDarkly

A flag allows you to manage a feature from the LaunchDarkly dashboard.

5.Wrap your code with a feature flag

Call BoolVariation to check the flag value for the user.

               
                  LDClient.get().BoolVariation("your.feature.key", user, false);
                      if (showFeature) {
                          // application code to show the feature
                      }
                      else {
                          // the code to run if the feature is off
                      }
                
              

6.Manage your flag

Use LaunchDarkly to determine which users see the feature.
You can roll out to a percentage of your users or target individual users/groups.

Testimonials
  • LaunchDarkly Testimonial
    I believe that feature flags are a critical piece of modern development, and LaunchDarkly brings this part of continuous delivery to the masses.
    - Rob Zuber, CTO, CircleCI
    LaunchDarkly Testimonial
    LaunchDarkly has been easy to on-board and integrate into our existing development cycle, which has helped us move faster with less risk.
    - Lawrence, VP Engineering, Ten-X

Try LaunchDarkly free for 30 days.

Continuously deliver and deploy software to your users in a faster, more reliable way. Get started today with a 30 day free trial.