[Virtual event] 6 new features for more control | Aug 26, 10 AM PT - Register.

Skip to:
BlogRight arrowProduct Updates
Right arrowLaunched: Support for Multiple Projects in the Android and iOS SDKs

Feb 21, 2019

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

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

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()
.setMobileKey("APP_MOBILE_KEY")
.setSecondaryMobileKeys(otherKeys);
.build();
</string,></string,>

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.

Like what you read?
Sign up for our newsletter
Letter in envelope icon
Sign up for our newsletter

Get all the content, tips, and news you can use.

By supplying my contact information, I authorize LaunchDarkly to contact me with personalized marketing communications about our products and services. See our Privacy Policy for more details, or Opt-Out at any time.