> For the complete documentation index, see [llms.txt](https://docs.getupdraft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getupdraft.com/updraft-sdk/android-sdk.md).

# Integrating Updraft Android SDK

Integrate Updraft into a native Android app (Views or Compose). The `updraft-sdk` artifact wires up the feedback UI and update prompts automatically. No manual hooks required.

**Source:** [github.com/appswithlove/updraft-sdk](https://github.com/appswithlove/updraft-sdk)

> **On 1.x?** The API changed in 2.0.0. See [Migrating from 1.x](/updraft-sdk.md).

### Requirements

* `minSdk` 23
* Kotlin 2.1+ (2.2+ if part of a KMP project)

### 1. Add the version catalog entry

In `gradle/libs.versions.toml`:

```toml
[versions]
updraft = "2.0.0"

[libraries]
updraft-sdk = { module = "com.appswithlove.updraft:updraft-sdk", version.ref = "updraft" }
updraft-core = { module = "com.appswithlove.updraft:updraft-core", version.ref = "updraft" }
updraft-ui-compose = { module = "com.appswithlove.updraft:updraft-ui-compose", version.ref = "updraft" }
```

Make sure `mavenCentral()` is in your repositories.

### 2. Add the dependency

In your app module's `build.gradle.kts`:

```kotlin
dependencies {
    implementation(libs.updraft.sdk)
}
```

### 3. Initialize at launch

```kotlin
class App : Application() {
    override fun onCreate() {
        super.onCreate()
        Updraft.start(
            UpdraftSettings(
                appKey = APP_KEY,
                sdkKey = SDK_KEY,
            ),
        )
    }
}
```

That's it. The SDK auto-registers via `androidx.startup`, so no further wiring is needed. Get `appKey` and `sdkKey` from your app on [getupdraft.com](https://getupdraft.com).

### Settings

See the full `UpdraftSettings` reference. Common overrides:

```kotlin
Updraft.start(
    UpdraftSettings(
        appKey = APP_KEY,
        sdkKey = SDK_KEY,
        logLevel = LogLevel.Debug,   // None | Error (default) | Debug
        showFeedbackAlert = true,    // shake-to-feedback hint
        feedbackEnabled = true,
        storeRelease = false,        // set true for Play Store builds to disable Updraft
        sendNavigationStack = true,
    ),
)
```

### Feedback

Testers trigger feedback by **shaking the device**. They can annotate the captured screenshot and submit it to the Updraft dashboard. Feedback is toggled per app on getupdraft.com and can be disabled locally with `feedbackEnabled = false`.

#### Custom feedback UI (optional)

If you don't want the built-in UI, provide your own presenter and send feedback manually:

```kotlin
Updraft.setFeedbackUiPresenter { screenshotPng ->
    // Show your own screen, then:
    Updraft.sendFeedback(screenshotPng, type, description, email)
        .collect { progress -> /* 0.0 → 1.0 */ }
}

// Call when your UI closes so shake detection re-arms
Updraft.onFeedbackUiClosed()
```

#### Navigation stack

Updraft can attach the list of open screens to each feedback report. Provide a resolver for your navigation library:

```kotlin
// Jetpack Compose Navigation
Updraft.navigationStackProvider = {
    listOfNotNull(navController.currentBackStackEntry?.destination?.route)
}

// Restore the platform default
Updraft.navigationStackProvider = null
```

Disable entirely with `sendNavigationStack = false` in `UpdraftSettings`.

#### Hosting the feedback event yourself (Compose)

For custom navigation into a feedback screen:

```kotlin
@Composable
fun App() {
    UpdraftEventHost(
        events = Updraft.events,
        onFeedbackRequested = {
            val screenshotPng = Updraft.takePendingScreenshot()
            navigateToFeedback(screenshotPng)
        },
    )
}
```

### Auto Update

Enable Auto Update on the getupdraft.com dashboard. The SDK compares the installed build number against the latest on the server and prompts testers to install newer versions. Micro-version comparison is supported (e.g. `1.2.3.20180804 > 1.2.3.20180803`).

### Logging

Default level is `LogLevel.Error` (errors and warnings only). For request/response inspection during development:

```kotlin
UpdraftSettings(..., logLevel = LogLevel.Debug)
```
