Skip to main content

Touchpad

Rokid Glasses touchpad gestures come through Android input handling. For an implementation example and optional phone/emulator touch fallback, see the Rokid Hello World starter.

Camera access

Use CameraX and bind the rear camera. The practical Rokid Glasses capture floor is 1024x768 at 15 fps; request 1024x768, not 768x1024, then set target rotation so CameraX applies the correct transform. Rokid Glasses expose only the rear/outward camera. Configure CameraX at the Application level to expose only CameraSelector.DEFAULT_BACK_CAMERA before any ProcessCameraProvider is initialized. This avoids CameraX front-camera validation retries on hardware that reports no front camera, and still works for Rokid-style phone/emulator testing with a back camera. Omit this only if the same app process needs front-camera features.
Register the Application in AndroidManifest.xml:
If the app already has a custom Application, implement CameraXConfig.Provider there instead of adding another Application class.
Request normal Android CAMERA permission before binding, and unbind the provider when the camera screen is no longer visible. Do not rely on Camera2 accepting sub-15 fps requests on Rokid; for lower outbound rates, capture at a supported mode and throttle downstream processing or WebRTC output.

Microphone access

Use the standard Android microphone stack. The Rokid-specific choices are MediaRecorder.AudioSource.MIC and mono capture. For direct PCM access, use AudioRecord:
Run AudioRecord.read(...) on a background thread with Process.THREAD_PRIORITY_AUDIO, then stop and release the recorder when capture ends. For WebRTC or another streaming stack that owns capture, configure that stack to use the same Rokid-friendly microphone path:
For simultaneous mic capture and speaker playback, use USAGE_MEDIA instead of a voice-call route and disable hardware AEC/noise suppression to avoid the vendor VOIP path. Request normal Android RECORD_AUDIO permission before starting either path.