---
title: "Connect with Android"
description: "Connect a Kotlin app, verify a published Experience, and test an update on an Android device."
sidebar:
  label: "Android"
search:
  tags: ["sdk", "setup", "android"]
  keywords: ["Kotlin", "Gradle", "Android", "install", "initialize", "integration_test"]
---

The Android SDK displays Experiences in your Kotlin app and handles events, purchases, and feature access. Once connected, you can publish new onboarding flows and paywalls without rebuilding the app. Requires Android API 23+ on arm64-v8a or x86_64.

1. **Installation**

    <span id="get-the-sdk" />

    ## Installation [toc]

    Open the [Android SDK repository](https://github.com/nuxieai/nuxie-android) in Android Studio. With JDK 17 and the checkout's Android toolchain installed, create the Maven publication for your app to use:

    ```sh title="Build the SDK package"
    ./gradlew :nuxie-android:publishReleasePublicationToStagingRepository
    ```

    Add that repository to your app's `settings.gradle.kts`, alongside Google and Maven Central:

    ```kotlin title="settings.gradle.kts"
    dependencyResolutionManagement {
        repositories {
            google()
            mavenCentral()
            maven {
                url = uri("/absolute/path/to/nuxie-android/build/maven-repository")
            }
        }
    }
    ```

    Add the SDK to the app module's `build.gradle.kts`:

    ```kotlin title="app/build.gradle.kts"
    dependencies {
        implementation("ai.nuxie:nuxie-android:0.1.0")
    }
    ```

    Use the version from the SDK checkout's root `build.gradle.kts` when preparing a different revision. Install through Maven so Gradle resolves the SDK's dependencies and included native runtime. The repository's [example app](https://github.com/nuxieai/nuxie-android/tree/main/example-app) shows a complete integration.

    <span id="configure-once" />

2. **Initialize**

    ## Initialize [toc]

    Copy your Android app's public key from **Connect your app**. Use its `pk_test_` key in development builds and `pk_live_` key in release builds. Keep the default service environment for both; the key selects preview or live content.

    Call setup once from your Application's `onCreate`:

    ```kotlin title="Application.onCreate" {4-5}
    import ai.nuxie.sdk.Nuxie
    import ai.nuxie.sdk.NuxieConfiguration

    val configuration = NuxieConfiguration("YOUR_ANDROID_PUBLIC_KEY")
    Nuxie.setup(applicationContext, configuration)
    check(Nuxie.isSetup)
    ```

    Handle setup exceptions before enabling interactions that use Nuxie. `isSetup` confirms local initialization; the connection status below confirms that the app reached Nuxie.

    <span id="check-the-connection" />

    Run your app on a device or simulator. **Connect your app** shows **Connected** after Nuxie receives a request from the SDK.

    <span id="prepare-the-experience-you-will-test" />
    <span id="add-a-test-trigger" />

3. **Trigger an Experience**

    ## Trigger an Experience [toc]

    [Publish an Experience](/docs/guides/publishing) for this app with the event trigger `integration_test`. Set its re-entry rule to **Every time** if you want to show it repeatedly while integrating. Add this call to a button handler after setup:

    ```kotlin
    import ai.nuxie.sdk.Nuxie

    Nuxie.trigger("integration_test")
    ```

    Tapping the button sends the event. Nuxie displays the Experience when the customer matches its audience and delivery rules. For an existing Experience, replace `integration_test` with its published event name.

    <span id="show-the-experience" />

    **Connect your app** changes to **Shown** after the SDK reports that the Experience appeared.

    <span id="try-a-remote-update" />

4. **Update an Experience**

    ## Update an Experience [toc]

    Edit the Experience and publish your changes. Bring the app back to the foreground to fetch the update, then send the event again with a customer who can re-enter. New Journeys use the updated version; a Journey already in progress keeps the version it started with. The app code stays the same.

    <span id="continue" />

    See the [SDK reference](/docs/reference/android) for identity, feature access, and App Actions. [Delivery](/docs/guides/delivery) explains trigger and audience configuration.
