# Android SDK

> Install and initialize the Bolt Android SDK for checkout, account login, or custom payment flows.

Source: https://help.boltapp.com/developers/sdks/android-kotlin

<span id="overview" />

The `com.bolt:checkout` package provides client APIs for Bolt Checkout, Bolt account login, and custom payment flows. Install and initialize it once, then continue to the guide for the capability you are building.

## Installation [#installation]

The SDK artifact is published to Maven Central. Add it to your app-level `build.gradle` or `build.gradle.kts` file:

```kotlin title="Kotlin"
dependencies {
    implementation("com.bolt:checkout:0.9.0")
}
```

You can find the latest version on [Maven Central](https://central.sonatype.com/artifact/com.bolt/checkout).

## SDK initialization [#sdk-initialization]

The SDK must be initialized **exactly once** during your application's lifecycle. The best place to do this is in your custom `Application` class's `onCreate()` method.

First, declare your application subclass in your `AndroidManifest.xml`:

```xml title="XML"
<application
    android:name=".MyApplication"
    ...>
</application>
```

Then initialize `BoltCheckout` with your application context, publishable key, and environment:

```kotlin title="Kotlin"
import android.app.Application
import com.bolt.checkout.BoltCheckout
import com.bolt.checkout.model.BoltEnvironment

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()

        BoltCheckout.init(
            application = this,
            publishableKey = "YOUR_PUBLISHABLE_KEY",
            environment = BoltEnvironment.PRODUCTION, // or BoltEnvironment.SANDBOX for testing
        )
    }
}
```

<Warning>
  `BoltCheckout.init()` will throw an exception if called more than once. `BoltCheckout.get()` will throw an exception if called before `init()` has completed successfully.
</Warning>

## Configuration requirements [#configuration-requirements]

To use the SDK, ensure you have the following credentials properly configured:

| Credential       | Where it's used       | Description                                                    |
| ---------------- | --------------------- | -------------------------------------------------------------- |
| `publishableKey` | `BoltCheckout.init()` | Your unique merchant identifier provided by Bolt.              |
| `orderToken`     | `BoltCheckoutConfig`  | A unique, per-checkout token generated by your backend server. |

## Next steps [#next-steps]

* **[Android checkout](/developers/sdks/android-kotlin/checkout/)**: Launch Bolt Checkout with an order token from your backend.
* **[SSO Login](/developers/sdks/android-kotlin/sso-login/)**: Authenticate users with their Bolt account via OAuth 2.0.
* **[Custom Checkout](/developers/sdks/android-kotlin/custom-checkout/)**: Build a custom checkout using the payment flow and authorization APIs.
* **[API Reference](/developers/sdks/android-kotlin/api-reference/)**: Full reference for all delegates, result types, and callbacks.

## Resources [#resources]

* [Maven Central: com.bolt:checkout](https://central.sonatype.com/artifact/com.bolt/checkout)
