Skip to content

Quickstart

Get from zero to displaying text on the glasses in 5 minutes.

What You'll Need

Requirement Details
Maverick AI / AI Pro glasses Or use the Glasses Simulator for development without hardware
API key sdk.key file - request one here
IDE Android Studio (Android / KMP) or Xcode (iOS)
Platform Android API 30 (Android 11) or iOS 16

BLE 5 is recommended for optimal performance.

Step 1 - Add the SDK

Provide credentials via ~/.gradle/gradle.properties:

gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_TOKEN_WITH_read_packages

Add the Maven repository and SDK dependency:

settings.gradle.kts
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

dependencyResolutionManagement {
    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
            }
        }
    }
}
build.gradle.kts
dependencies {
    implementation("com.everysight.mav2:maverick-ai-sdk:0.1.0")
}

Add the SPM package in Xcode:

File → Add Package Dependencies → enter the mav-ai-ios-spm repository URL.

Step 2 - Initialize the SDK

Evs.init(applicationContext)
Evs.init(applicationContext) // androidMain - pass null on iosMain: Evs.init()
Evs.shared.doInit()
Evs.resourcesService.setResourcesResolver(object : IM2ResourcesResolver {
    override fun loadResource(path: String): ByteArray? = try {
        runBlocking { Res.readBytes("files/$path") }
    } catch (e: Exception) { null }
})

Place your sdk.key file in the app resources:

  • Native Android: app/src/main/assets/sdk.key
  • Native iOS: at the iOS app bundle root (Xcode → "Copy Bundle Resources")
  • KMP Compose: composeApp/src/commonMain/composeResources/files/sdk.key

For the full picture (where every kind of resource goes, what build scripts you need, when a resolver is required) see the Resources guide.

Step 3 - Display Content on the Glasses

class HelloScreen : M2Screen(540f, 280f) {
    override fun onCreate() {
        val title = M2Text()
        title.setFont(M2FontResource.fontMedium)
            .setText("Hello Maverick AI!")
            .setAlign(Align.CenterHorizontal)
            .setX(width / 2f).setY(height / 2f)
            .setColor(M2Color.White)
        add(title)
    }
}

Connect and display:

Evs.showUI(M2ShowUIOption.DefaultConfigure)

Evs.glassesService.registerConnectionListener(object : IM2GlassesConnectionEvents {
    override fun onReady() {
        Evs.screenService.addScreen(HelloScreen())
    }
})
Evs.shared.showUI(option: M2ShowUIOption.companion.DefaultConfigure)

// After connection is ready:
Evs.shared.screenService.addScreen(screen: HelloScreen())

Next Steps