Launched: Support for Multiple Projects in the Android and iOS SDKs

By Joe Cieslik   •   February 21, 2019

In our mission to support releasing software with confidence, we've added the ability to store and switch between multiple LaunchDarkly projects on our Android and iOS clients. You now have first-class support from our SDKs for flags used across multiple projects. For example, if you have an app that depends on shared backend services maintained by other teams, you might need to maintain the flags in separate projects but use flags from these projects within the app. As with previous SDK releases, the client can react to feature flag updates in real time for all subscribed environments. This new feature does not represent a breaking API change, and developers will not need to change the way they interface with either SDK.

To get started with this exciting new part of our SDK here's an Android example. Let's assume in this scenario we have a mobile app that depends on a common platform shared by other applications. First we need to add the mobile keys for other related projects to our configuration object, and our SDK will listen to flag updates for all subscribed projects in the background.

Map<string, string> otherMobileKeys = new HashMap<string, string>();
otherKeys.put("platform", "PLATFORM_MOBILE_KEY"); 
LDConfig ldConfig = new LDConfig.Builder()        

Once the client is initialized, you only need to call one method to get access to the client instance for the project of your choice.

LDClient platformInstance = LDClient.getForMobileKey("platform");
platformInstance.boolVariation("platform-specific-flag", false);

We hope this addition to our Android and iOS SDKs empowers you to build new and exciting products and launch fearlessly! For more information see our documentation on multiple environments for Android.

You May Like
  •   BEST PRACTICESTesting in Production for Safety and Sanity
  •   BEST PRACTICESWhat Is Continuous Testing? A Straightforward Introduction
APRIL 8, 2021   •   BEST PRACTICES4 Software Release Management Best Practices
APRIL 6, 2021   •   BEST PRACTICESTest Environments 101: Definition, Types, and Best Practices
APRIL 1, 2021   •   Team & NewsWhat to Expect at LaunchDarkly Galaxy
MARCH 30, 2021   •   Team & NewsHow We've Been Celebrating Women’s History Month