CXR-L(EN)
CXR-L(EN)
IntroductionQuick StartDevelopment Flow & State-MachineTerms and Abbreviations
Feature Development
Version HistoryAndroid
iOS
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)
- Zip package:
https://rokid-ota.oss-cn-hangzhou.aliyuncs.com/toB/Document/CXR-L/v1.0.1/image/samples/cxrlsample101.zip
iOS (ios_cxr_l_sample)
- Zip package:
https://rokid-ota.oss-cn-hangzhou.aliyuncs.com/toB/Document/CXR-L/v1.0.1/iOS/ios_cxr_l_sample.zip
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
CUSTOMAPPdemo depends on the package whose name matchesCONSTANT.APP_PACKAGE_NAME(defaultcom.rokid.cxrswithcxrl).
Minimal verification path (Android)
- Open CXRLSample in Android Studio and sync Gradle (must be able to access
https://maven.rokid.com/repository/maven-public/). - Build and install to the phone; confirm Rokid AI App is installed.
- Complete authorization in
MainActivityand confirm a token is obtained (seeMainViewModel.checkAuthorizationResult). - Enter either CustomView or CustomApp, and wait until both
onCXRLConnectedandonGlassBtConnectedindicate an available state (link ready). - 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
openAppandIGlassAppCbk).
- CustomView: tap to open the custom view until the status becomes “opened” and “Enter Audio / Enter Photo” buttons appear (depends on
- 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)
- Configure Pods,
Info.plist, and URL callbacks according to “iOS/SDK Import”. - Forward
CxrClient.shared.handleOpenURLinAppDelegate/SceneDelegate. - Call
client.auth.authenticateto complete authentication. - 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).
- 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)
| Scenario | Source path |
|---|---|
| Home / install check / auth | activities/main/MainActivity.kt, MainViewModel.kt |
| CustomView session | activities/customViewType/CustomViewTypeActivity.kt, CustomViewTypeViewModel.kt |
| CustomApp session | activities/customAppType/CustomAppTypeActivity.kt, CustomAppTypeViewModel.kt |
| Audio | activities/audio/AudioUsageActivity.kt, AudioUsageViewModel.kt |
| Photo | activities/photo/PhotoUsageActivity.kt, PhotoUsageViewModel.kt |
| Custom Command | activities/customCMD/CustomCmdActivity.kt, CustomCmdViewModel.kt |
Global CXRLink | CXRLSampleApplication.kt |
iOS (based on CXR-L iOS integration notes and typical demo naming)
| Scenario | Common location (follow the actual files in the ios_cxr_l_sample repo) |
|---|---|
| Auth and capability buttons | ViewController.swift (or the app’s main UIViewController) |
| URL callbacks | AppDelegate.swift, SceneDelegate.swift |
| Custom View JSON / icons | CustomViewItems.swift, etc. |