Skip to content

Android Libraries Setup

Overview

This guide covers integrating the Maverick AI SDK into a native Android project (Kotlin + Jetpack Compose or XML).

Building a cross-platform app?

For new projects, consider Compose Multiplatform (KMP) - the recommended path that lets you share UI and logic across Android and iOS.

The SDK is distributed via Maven (GitHub Packages):

Name Maven Artifact Description
Maverick AI SDK com.everysight.mav2:maverick-ai-sdk-android Core SDK for native Android projects

Add GitHub Packages Repository

1) Add repository

Add the GitHub Packages Maven repository to your settings.gradle.kts:

settings.gradle.kts
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://maven.pkg.github.com/everysight-maverick-AI/mav-ai-android-maven")
            credentials {
                username = providers.gradleProperty("gpr.user").orNull
                password = providers.gradleProperty("gpr.key").orNull
            }
        }
    }
}

Note

You must create a GitHub personal access token with the read:packages scope.

Create credentials in ~/.gradle/gradle.properties:

gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_TOKEN_WITH_read:packages

2) Add dependencies

In your module build.gradle.kts:

app/build.gradle.kts
dependencies {
    implementation("com.everysight.mav2:maverick-ai-sdk-android:0.1.0")
}

For version-catalog users (libs.versions.toml):

[versions]
mavai = "1.0.1"

[libraries]
mavai-sdk = { module = "com.everysight.mav2:maverick-ai-sdk-android", version.ref = "mavai" }

SDK Initialization

Initialize the SDK in your Activity.

MainActivity.kt
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Evs.init(applicationContext)
        setContent { /* your Compose UI */ }
    }

    override fun onDestroy() {
        Evs.stop()
        super.onDestroy()
    }
}

Resources

Drop your files into the standard Android locations:

Kind Where
API key (sdk.key / app.key) app/src/main/assets/sdk.key
Glasses content (M2Image, M2Font, AR .obj/.png) app/src/main/assets/<your-path> (for example assets/files/images/apple.png)
Phone-UI assets app/src/main/res/..., accessed via R.drawable.foo / painterResource(R.drawable.foo)

See the Resources guide for the equivalent rules on iOS and KMP.

Proguard / R8

Consumer proguard rules are shipped with the SDK Maven artifacts and applied automatically. If your app has aggressive minification, verify runtime flows (serialization, reflection-based libs, media paths) in release builds.


See Also