> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Android SDK

> Install and initialize the LaunchDarkly Android SDK

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

<div>
  <ReadmeButton sdk={SDK.Android} />

  <CursorButton sdk={SDK.Android} />
</div>

### Install the package

<CodeGroup>
  ```groovy title={"Groovy"} theme={null}
    implementation 'com.launchdarkly:launchdarkly-android-client-sdk:5.+'

  ```

  ```kotlin title={"Kotlin"} theme={null}
    implementation("com.launchdarkly:launchdarkly-android-client-sdk:5.+")

  ```
</CodeGroup>

The SDK uses [AndroidX from Jetpack](https://developer.android.com/jetpack/androidx). If your project does not use AndroidX,
read [Android's migration guide](https://developer.android.com/jetpack/androidx/migrate).

### Initialize the SDK

```kotlin title={"Android SDK initialization"} theme={null}
import com.launchdarkly.sdk.*
import com.launchdarkly.sdk.android.*;

val ldConfig = LDConfig.Builder(AutoEnvAttributes.Enabled)
    .mobileKey("YOUR_MOBILE_KEY")
    .build()

// A "context" is a data object representing users, devices, organizations, and other entities.
val context = LDContext.create("EXAMPLE_CONTEXT_KEY")

// If you don't want to block execution while the SDK tries to get
// latest flags, move this code into an async IO task and await on its completion.
val client: LDClient = LDClient.init(this@BaseApplication, ldConfig, context, 5)

```

<Accordion title="Finding your SDK credentials">
  You can find your server-side SDK key, client-side ID, and mobile key in the "Resources" section of the help menu. Click the **help icon** at the bottom left corner of the LaunchDarkly UI, then choose **SDK keys**:

  <Frame caption="The SDK keys option in the help menu.">
    ![The SDK keys option in the help menu.](https://files.buildwithfern.com/https://launchdarkly.docs.buildwithfern.com/docs/28d3e1c568378ea02528db7ba62bfbd742f6f1cad964b5675395e10af5eeeb60/assets/images/auto/help-menu-sdk-keys.auto.png)
  </Frame>
</Accordion>

To learn more, read [Initialize the client](/sdk/client-side/android#initialize-the-client) in the Android SDK reference guide.
