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

Introduction

CXR-L SDK Introduction

Positioning

The CXR-L SDK runs on the mobile phone. It works with Rokid Glasses and the Rokid AI App (or Hi Rokid) to complete authentication, session establishment, Custom View, glasses-side app control, audio, photo capture, and custom commands.

Typical flow:

  1. Integrate the SDK and guide the user to install/launch the required app.
  2. Obtain a token through authorization.
  3. Establish a CustomView or CustomApp session and keep the link available.
  4. Complete scene building on the glasses.
  5. Use photo capture, audio, and custom commands after the scene is ready.

Scene building means the glasses have reached the business working state — not merely phone-side connect success.

  • CustomView: customViewOpen succeeds and onCustomViewOpened is received.
  • CustomApp: target package installed and appStart succeeds; app is foreground/interactive.

Custom commands are available only in CustomApp sessions.

Core capabilities

CapabilityDescription
Connection and sessionCreate link, configure session type, register callbacks, connect(token)
Glasses Custom ViewLayout JSON + icon resources; open, update, close
Glasses Custom AppQuery/install/upload APK, start, stop, uninstall
Custom commandBidirectional messages (CustomApp only)
AudioPCM audio stream
Photo captureRemote JPEG capture

Capability prerequisites

CapabilityPrerequisites
AudioScene building complete; reuse global CXRLink
Photo captureSame as audio
Custom commandCustomApp only; glasses app opened

Capability availability matrix

Session / stateAudioPhotoCustom command
Not authenticatedNoNoNo
Authenticated, not connectedNoNoNo
Connected, scene not builtNoNoNo
CUSTOMVIEW + view openedYesYesNo
CUSTOMAPP + app openedYesYesYes

Sample projects

Android (v1.0.3)

iOS (v1.0.1)

  • Project: ios_cxr_l_sample
  • SDK: CocoaPods RGCxrClient (see iOS chapters)

CXR-S SDK (glasses)

The CXR-S SDK (Maven artifact cxr-service-bridge) lets Rokid glasses-side Android apps join the CXR protocol and work with phone-side CXR-L. The phone app handles auth, sessions, and remote control; the glasses app runs CustomApp logic and exchanges Caps with the phone.

SideSDKRuntimeResponsibility
PhoneCXR-L (client-l)Phone appAuth, sessions, CustomView, CustomApp remote control, audio/photo/custom commands
GlassesCXR-S (cxr-service-bridge)Glasses Android appCustomApp logic, CXRServiceBridge, Caps with phone
  • CustomView session: phone sends layout JSON via CXR-L; phone app does not embed CXR-S.
  • CustomApp session: phone installs/launches the glasses APK via CXR-L; that APK must integrate CXR-S and match CUSTOMAPP.packageName.

CXRSWithCXRLSample (com.rokid.cxrswithcxrl) pairs with RenewCXRLSample. This Sample covers CustomApp + custom commands + key reporting only — not CustomView rendering, audio, or photo (future doc releases).

ItemValue
Glasses packagecom.rokid.cxrswithcxrl
Entry Activity.activities.main.MainActivity
SDK dependencycom.rokid.cxr:cxr-service-bridge (version per Sample / release notes)
Zip packagecxrssample.zip

Related chapters: SDK Integration (glasses-side), Glasses Custom App, Custom Commands, Keys and System Broadcasts.

Link ready before CustomView/CustomApp APIs: onCXRLConnected(true) and onGlassBtConnected(true).

Marcin Miazga