> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stringboot.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Add the Stringboot SDK to your Android project

***

## 1. Add Dependency

Add the Stringboot SDK to your app-level `build.gradle.kts`:

```kotlin theme={null}
dependencies {
    implementation("com.stringboot:stringboot-android-sdk:1.2.3")
}
```

Click **Sync Now** to download the SDK.

## 2. Configure Manifest

Add your API credentials to `AndroidManifest.xml` inside the `<application>` tag:

```xml theme={null}
<application ...>
    <!-- Stringboot Configuration -->
    <meta-data
        android:name="com.stringboot.api_url"
        android:value="https://api.stringboot.com" />
    <meta-data
        android:name="com.stringboot.api_token"
        android:value="YOUR_API_TOKEN_HERE" />
    <meta-data
        android:name="com.stringboot.cache_size"
        android:value="1000" />
</application>
```

<Note>
  Replace `YOUR_API_TOKEN_HERE` with your actual API token from the Stringboot Dashboard.
</Note>

## 3. Initialize SDK

We recommend initializing the SDK in your `Application` class. This "Production-Ready" snippet includes setup for all features (A/B Testing, FAQs, Logging).

<Tabs>
  <Tab title=" Basic (Strings only)">
    ```kotlin theme={null}
    class MyApplication : Application() {
        override fun onCreate() {
            super.onCreate()

            StringProvider.initialize(
                context = this,
                cacheSize = 1000
            )
            
            // Trigger initial sync
            CoroutineScope(Dispatchers.IO).launch {
                 StringProvider.refreshFromNetwork(StringProvider.deviceLocale())
            }
        }
    }
    ```
  </Tab>

  <Tab title="Production Ready (Strings + Dynamic FAQs)">
    ```kotlin theme={null}
    class MyApplication : Application() {
        override fun onCreate() {
            super.onCreate()

            // 1. Define Analytics Handler (for A/B Testing)
            val analyticsHandler = object : StringbootAnalyticsHandler {
                override fun onExperimentAssigned(assignment: ExperimentAssignment) {
                    // Log to your analytics provider
                    Firebase.analytics.logEvent("experiment_assigned") {
                        param("experiment_key", assignment.experimentKey)
                        param("variant", assignment.variantName)
                    }
                }
                override fun onExperimentViewed(key: String, variant: String) {
                     Firebase.analytics.logEvent("experiment_viewed") { ... }
                }
            }

            // 2. Initialize Stringboot
            StringProvider.initialize(
                context = this,
                cacheSize = 1000,
                analyticsHandler = analyticsHandler,
                providedDeviceId = "USER_ID" // Optional: Custom User ID
            )

            // 3. Initialize FAQ Provider
            FAQProvider.initialize(
                context = this,
                cacheSize = 200
            )

            // 4. Configure Logging (Debug builds only)
            if (BuildConfig.DEBUG) {
                StringbootLogger.logLevel = StringbootLogger.Level.DEBUG
            }
            
            // 5. Trigger Initial Sync
            CoroutineScope(Dispatchers.IO).launch {
                 StringProvider.refreshFromNetwork(StringProvider.deviceLocale())
                 FAQProvider.refreshFromNetwork()
            }
        }
    }
    ```
  </Tab>
</Tabs>

<Tip>
  This single initialization block sets up the core SDK. Uncomment the specific lines to enable A/B Testing tracking or custom logging.
</Tip>

## Next Steps

Now that you've installed the SDK, learn how to use it in your app.

<Card title="Basic Usage" icon="arrow-right" href="/android-sdk/usage">
  Fetch strings and update your UI
</Card>
