CXR-L(EN)
cxr-l-sdk · v1.0.1 · snapshot 2026-05-13· ↗ source

Quick Start

Quick Start

Environment prerequisites

  • A real device or a Bluetooth-debuggable environment, already paired/connected with the target glasses.
  • The phone has Rokid AI App installed.
  • You have read the capability prerequisites in “Introduction”.

Get the phone-side Samples

Android (CXRLSample)

iOS (ios_cxr_l_sample)

Glasses side

  • For collaborative debugging with the phone, you can install the glasses-side sample app and assets:
    https://rokid-ota.oss-cn-hangzhou.aliyuncs.com/toB/Document/CXR-L/v1.0.1/image/samples/sSDKSampleforCXR.zip
  • The Android CUSTOMAPP demo depends on the package whose name matches CONSTANT.APP_PACKAGE_NAME (default com.rokid.cxrswithcxrl).

Minimal verification path (Android)

  1. Open CXRLSample in Android Studio and sync Gradle (must be able to access https://maven.rokid.com/repository/maven-public/).
  2. Build and install to the phone; confirm Rokid AI App is installed.
  3. Complete authorization in MainActivity and confirm a token is obtained (see MainViewModel.checkAuthorizationResult).
  4. Enter either CustomView or CustomApp, and wait until both onCXRLConnected and onGlassBtConnected indicate an available state (link ready).
  5. Complete scene building on the glasses side:
    • CustomView: tap to open the custom view until the status becomes “opened” and “Enter Audio / Enter Photo” buttons appear (depends on onCustomViewOpened).
    • CustomApp: ensure the target APK is installed first, then tap to open the scene until the status becomes “scene opened” and buttons for Audio, Photo, and Custom Command appear (depends on openApp and IGlassAppCbk).
  6. Then enter the Audio / Photo pages to verify. Custom Command is only entered from CustomApp, and only after the scene is opened and the entry becomes available.

Important: Photo capture, audio, and custom commands must all be used after scene building is completed. It is not allowed to call these capabilities right after connect succeeds.

Minimal verification path (iOS)

  1. Configure Pods, Info.plist, and URL callbacks according to “iOS/SDK Import”.
  2. Forward CxrClient.shared.handleOpenURL in AppDelegate / SceneDelegate.
  3. Call client.auth.authenticate to complete authentication.
  4. Establish the link and complete scene building on the glasses side (the Custom View is running, or the Custom App has been launched as required by the SDK).
  5. Then verify Audio, Photo, and Custom Command; the order and event subscriptions are described in the dedicated chapters.

Important: Same as on Android, Photo, Audio, and Custom Command must be used only after scene building is completed; you cannot rely solely on “authenticated + link connected”.

Sample entry cross-reference

Android (package prefix com.rokid.cxrlsample)

ScenarioSource path
Home / install check / authactivities/main/MainActivity.kt, MainViewModel.kt
CustomView sessionactivities/customViewType/CustomViewTypeActivity.kt, CustomViewTypeViewModel.kt
CustomApp sessionactivities/customAppType/CustomAppTypeActivity.kt, CustomAppTypeViewModel.kt
Audioactivities/audio/AudioUsageActivity.kt, AudioUsageViewModel.kt
Photoactivities/photo/PhotoUsageActivity.kt, PhotoUsageViewModel.kt
Custom Commandactivities/customCMD/CustomCmdActivity.kt, CustomCmdViewModel.kt
Global CXRLinkCXRLSampleApplication.kt

iOS (based on CXR-L iOS integration notes and typical demo naming)

ScenarioCommon location (follow the actual files in the ios_cxr_l_sample repo)
Auth and capability buttonsViewController.swift (or the app’s main UIViewController)
URL callbacksAppDelegate.swift, SceneDelegate.swift
Custom View JSON / iconsCustomViewItems.swift, etc.
Marcin Miazga