CXR-L(EN)
CXR-L(EN)
IntroductionQuick StartDevelopment Flow & State-MachineTerms and Abbreviations
Feature Development
Version HistoryAndroid
iOS
cxr-l-sdk · v1.0.3 · snapshot 2026-06-02· ↗ source
Photo Capture
Android: Photo Capture
Overview
Register the image stream callback on CXRLink, call takePhoto(width, height, quality) to trigger capture on the glasses, and receive JPEG bytes via IImageStreamCbk.onImageReceived.
Prerequisites
- Global
CXRLinkconnected (same as Audio chapter). - Scene building completed.
GlassPermission.CAMERArecommended.
Core APIs
| Method | Description |
|---|---|
setCXRImageCbk(IImageStreamCbk) | Register image callbacks |
takePhoto(width: Int, height: Int, quality: Int) | Trigger capture; quality is JPEG 0–100 |
IImageStreamCbk callbacks
| Callback | Description |
|---|---|
onImageReceived(data: ByteArray?) | JPEG bytes; decode with BitmapFactory |
onImageError(code, msg?) | Capture failed |
Example
link.takePhoto(1024, 768, 80)
Constraints
- Wait for callback before the next capture to avoid concurrency issues.
- Do not call when link is down.
- Clear Image callback on sub-page destroy; do not
disconnect().
Appendix: reference sample
RenewCXRLSample PhotoUsageViewModel.