CXR-L(EN)
cxr-l-sdk · v1.0.3 · snapshot 2026-06-02· ↗ source

Quick Start

Quick Start

Environment prerequisites

  • Real device or Bluetooth-debuggable environment, paired with target glasses.
  • Rokid AI App (mainland, version ≥ 1.7.14) or Hi Rokid (overseas) installed.
  • Understand capability prerequisites in the Introduction.

Get the phone-side Samples

Android (RenewCXRLSample, v1.0.3)

iOS (ios_cxr_l_sample, v1.0.1)

Glasses side (CXRSWithCXRLSample)

Extract and open the cxrswithcxrl project in Android Studio; sync Gradle (https://maven.rokid.com/repository/maven-public/). Package com.rokid.cxrswithcxrl matches RenewCXRLSample CONSTANT.

Minimal verification path (Android)

  1. Open RenewCXRLSample in Android Studio; sync Gradle (https://maven.rokid.com/repository/maven-public/).
  2. Confirm SDK dependency is com.rokid.cxr:client-l:1.0.3 in app/build.gradle.kts.
  3. Build and install; confirm Rokid AI App ≥ 1.7.14 (mainland) or Hi Rokid (overseas).
  4. Complete authorization on the home screen; obtain token.
  5. Choose CustomView or CustomApp; enter CxrSessionActivity.
  6. Wait for link ready: onCXRLConnected(true) and onGlassBtConnected(true) (both session types).
  7. Complete scene building:
    • CustomView: after link ready, customViewSetIcons (if needed) and customViewOpenonCustomViewOpened
    • CustomApp: APK installed (with storage permissions), appStartonOpenAppResult(true)
  8. Enter Audio / Photo from hub; Custom Command from CustomApp only.

Important: Use photo, audio, and custom commands only after scene building.

CustomApp joint-debug path (phone + glasses)

Under a CUSTOMAPP session, verify custom commands and key reporting:

  1. Install CXRSWithCXRLSample on glasses (or via appUploadAndInstall).
  2. Install RenewCXRLSample on the phone; complete auth and obtain token.
  3. Choose CustomApp → Session Hub; wait for link ready (CXR + Bluetooth).
  4. Complete scene building: install/start APK from Hub, receive onOpenAppResult(true); glasses MainViewModel runs subscribe(“rk_custom_client”, …).
  5. Open Custom Commands: phone sendCustomCmd ↔ glasses sendMessage.
  6. Press leg keys, touchpad, or back on glasses; phone should receive rk_custom_key payloads.
Rendering diagram…
ConstantValue
APP_PACKAGE_NAMEcom.rokid.cxrswithcxrl
MAIN_PAGE.activities.main.MainActivity
appStart argument”${APP_PACKAGE_NAME}${MAIN_PAGE}”

Minimal verification path (iOS)

  1. Configure Pod, Info.plist, and URL callbacks per the iOS SDK Integration chapter.
  2. Forward CxrClient.shared.handleOpenURL in AppDelegate / SceneDelegate.
  3. Call client.auth.authenticate.
  4. Establish link and complete scene building on glasses.
  5. Verify audio, photo, custom command per dedicated chapters.

Important: Same gating as Android — capabilities require scene building, not link-only success.

Appendix: RenewCXRLSample modules

ModulePath
Home / authactivities/main/
Session hubactivities/session/SessionHubViewModel.kt
Connectionlink/CxrLinkConnectionHub.kt, utils/CxrSessionGate.kt
Capabilitiesactivities/audio/, photo/, customCMD/
Global linkapp/CXRLApplication.kt
Glasses demoCXRSWithCXRLSample — activities/main/, receiver/KeyReceiver.kt
Marcin Miazga