Theme
Last updated: 2026-11-10
The Android and iOS SDKs work directly in native apps and do not need the Flutter runtime. They parse your license file, pick the license for the exact serial number you connect, run enterprise authorization and authentication on both sides of the glasses, and handle time sync and EvenHub commands. Both are version 0.1.0-beta.14.
Android
The SDK is on Maven Central as com.evenrealities.devices:even-devices-native-android:0.1.0-beta.14. Merge the repositories into your existing dependency repositories:
kotlin
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}Add the dependency to app/build.gradle.kts:
kotlin
dependencies {
implementation("com.evenrealities.devices:even-devices-native-android:0.1.0-beta.14")
}The minimum Android version is API 21. The library uses Java and Kotlin 17 bytecode.
Request Bluetooth permissions before you use the SDK. On Android 12 and later, request BLUETOOTH_SCAN and BLUETOOTH_CONNECT. On earlier versions, request location permission and turn on the system location service for scanning.
kotlin
import android.content.Context
import com.evenrealities.devices.EnterpriseLicenseBundle
import com.evenrealities.devices.EvenDevicesAndroidBle
import com.evenrealities.devices.G2Endpoint
fun initializeGlasses(context: Context, licenseJson: String) {
val licenses = EnterpriseLicenseBundle.fromJsonString(licenseJson)
val sdk = EvenDevicesAndroidBle.instance
sdk.initialize(
context,
licenses,
onEvent = { event -> /* Show discovery and transport diagnostics. */ },
onG2AuthEvent = { event ->
if (event.ready) {
// Both temples passed enterprise authorization and business AUTH.
// Enable your UI actions for event.sn and event.generation.
}
},
onG2TimeSyncEvent = { event -> /* Check event.success. */ },
onEvenHubEvent = { event -> /* Observe phase, heartbeatCount and input. */ },
)
sdk.scan()
}
fun connectGlasses(sn: String, left: G2Endpoint, right: G2Endpoint) {
val sdk = EvenDevicesAndroidBle.instance
sdk.stopScan()
// Use both original endpoint addresses and names discovered for this SN.
sdk.connectG2(sn, left, right)
}After the whole device is ready, call sdk.openEvenHubTextPage("Hello Even Hub"). Events confirm that the page opened and each renewal; submitting the request does not prove the page is shown. Call sdk.closeEvenHub() when you are done, then sdk.disconnectG2(left, right) or sdk.reset() to tear down.
iOS
In Xcode, choose File > Add Package Dependencies, enter https://github.com/even-realities/flutter_enterprise_sdk.git, choose the exact version 0.1.0-beta.14, and add the EvenDevicesSDK product to your app target.
In a Swift package, add:
swift
.package(
url: "https://github.com/even-realities/flutter_enterprise_sdk.git",
exact: "0.1.0-beta.14"
)Then add .product(name: "EvenDevicesSDK", package: "flutter_enterprise_sdk") to your target's dependencies. Xcode downloads the framework with the Git tag, with no separate download link or token.
The minimum iOS version is 15.0. The XCFramework supports arm64 devices, and arm64 and x86_64 simulators. Add NSBluetoothAlwaysUsageDescription to your app's Info.plist. Keep the SDK object for your session, and make SDK calls on the main queue.
swift
import Foundation
import EvenDevicesSDK
func makeGlassesSDK(licenseJSON: Data) throws -> EvenDevicesG2SDK {
let licenses = try EnterpriseLicenseBundle(jsonData: licenseJSON)
let sdk = EvenDevicesG2SDK(
namespace: "my-enterprise-app",
licenseBundle: licenses,
onEvent: { event in
if event.phase == .ready && event.side == nil {
// Both temples are authorized; enable device actions.
}
// Discovery includes serialNumber, side and endpointID.
},
onEvenHubEvent: { event in
// Observe native page state, heartbeat acknowledgements and input.
}
)
sdk.scan()
return sdk
}After both sides of the selected serial number are discovered, call sdk.connectG2(serialNumber: selectedSN). You can pass endpoint UUIDs you stored earlier as a complete G2EndpointPair; they only locate the glasses and do not skip authorization. After the whole device is ready, call try sdk.openEvenHubTextPage(text: "Hello Even Hub"), and finish with try sdk.closeEvenHub() and sdk.disconnect().
Microphone audio
After both sides are ready and the EvenHub page is active, turn on the glasses microphone and wait for the command result. Audio starts once the firmware acknowledges it.
Kotlin:
kotlin
sdk.executeEvenHubCommand("audioControl", mapOf("enabled" to true)) { result -> /* handle result */ }In onEvenHubEvent, when event.event == "audioEvent", read event.details["audioPcm"] as? ByteArray.
Swift:
swift
sdk.executeEvenHubCommand(commandName: "audioControl", parameters: ["enabled": true]) { result in /* handle result */ }In onEvenHubEvent, when event.event == "audioEvent", read event.details["audioPcm"] as? Data.
The audio format is the same on every platform, see Microphone audio.
Firmware updates
Pass onOtaEvent when you initialize the SDK. After both sides are ready, pass the complete G2 EVENOTA firmware file and the target firmware version from the release.
Kotlin:
kotlin
val operation = sdk.startOta(firmware, targetVersion) // ByteArray, String
// If the user cancels this operation:
sdk.cancelOta(operation)Swift:
swift
let operation = try sdk.startOta(firmware: firmware, targetVersion: targetVersion) // Data, String
// If the user cancels this operation:
sdk.cancelOta(operationId: operation)Match events to the returned operation ID. transportCompleted means the transfer to both sides finished. The SDK checks the installed version on both sides after the glasses reconnect, then sends succeeded. If a version does not match or cannot be read back, the installation is not verified.
Licenses
Pass the whole license file from the portal unchanged. The SDK validates every entry and uses only the entry for the serial number you connect. Glasses that are not in the file are refused before connecting. A scanned device, or a single side that succeeded, does not mean the whole device is ready.