Connect with Android
Connect a Kotlin app, verify a published Experience, and test an update on an Android device.
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.
Installation
Installation
Open the Android SDK repository in Android Studio. With JDK 17 and the checkout’s Android toolchain installed, create the Maven publication for your app to use:
./gradlew :nuxie-android:publishReleasePublicationToStagingRepositoryAdd that repository to your app’s settings.gradle.kts, alongside Google and Maven Central:
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:
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 shows a complete integration.
Initialize
Initialize
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:
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.
Run your app on a device or simulator. Connect your app shows Connected after Nuxie receives a request from the SDK.
Trigger an Experience
Trigger an Experience
Publish an Experience 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:
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.
Connect your app changes to Shown after the SDK reports that the Experience appeared.
Update an Experience
Update an Experience
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.
See the SDK reference for identity, feature access, and App Actions. Delivery explains trigger and audience configuration.