Skip to content

Rokid glasses ​

This headless Android example runs directly on compatible Rokid glasses. It uses the shared Gelato Android protocol client plus a glasses-local Camera2 driver; it does not require a phone companion after enrollment. USB/ADB is used only for installation, first enrollment, and optional maintenance. The Controller connection and camera observations then use Wi-Fi.

First enrollment over USB ​

  1. Connect the glasses by USB with debugging authorized, and make sure the glasses are already on Wi-Fi. USB is only the initial installer/configuration channel.
  2. From the repository root, run node examples/device/rokid-native-app/scripts/commission.mjs --allow-control. If multiple ADB devices are present, add --serial GLASSES_SERIAL. The script checks Android API level and Wi-Fi, builds and installs the APK, grants camera and microphone access, handles the Rokid background AppOps, and verifies those grants. --allow-control is explicit consent to start camera and microphone streaming after pairing; omit it if the owner wants to pair now but keep media and remote control paused.
  3. When prompted, open the private Controller console, select Rokid BOLON glasses (native) under Pair a device, and paste its new gelato://pair link into the terminal. The script hides terminal input and checks that the link is for this device type and contains a valid HTTPS Controller root and one-time code. The public device ingress does not expose the console or its operator API.
  4. Wait for the script to print Paired: dev_.... Then remove USB and check in the private Controller console that the glasses remain online. If --allow-control was selected, also check that the camera frame sequence advances. The phone companion is not needed.

The setup link is intentionally requested after building and installing, so its short lifetime is not spent waiting for Gradle. Do not put the link or code in command arguments, source files, or APK assets. ADB necessarily carries the code during the one-time enrollment; a commissioning host with ADB access must be trusted. The script needs a local interactive terminal and Android platform-tools; --skip-build --apk /path/to/app.apk can be used for a prebuilt APK.

To upgrade an already paired device, run the same command with --update-only (and without --allow-control). This does not request a new code or change owner consent. It reapplies background AppOps after installing because the tested Rokid firmware resets them on APK replacement, then restarts the saved connection. The install helper refuses to enroll an already installed app unless --re-enroll is explicitly supplied. adb install -r does not clear existing credentials; revocation or transfer must be deliberate Controller/owner operations.

The bootstrap activity and service require the system DUMP permission, which the ADB shell holds and ordinary third-party apps do not.

The app keeps credentials in the shared SDK's Android Keystore-backed store. Pairing and control consent are independent: an ADB start of the bootstrap activity with action dev.galatea.rokid.nativeexample.CONTROL and boolean extra enabled=false pauses remote commands and camera media without revoking pairing. Action dev.galatea.rokid.nativeexample.CONNECTION with enabled=false stops the connection and foreground service while preserving pairing; enabled=true resumes it.

The camera uses a repeating YUV preview converted to one JPEG per second. camera.capture returns the most recent preview frame, rather than triggering a separate still capture. The firmware may still emit its own camera-use indication. With the Qwen Live Harness Controller integration enabled, the glasses also upload 16 kHz mono PCM16 microphone frames and play authenticated, checksum-verified 24 kHz mono PCM16 replies through their local audio route. Pausing control stops capture and playback without deleting pairing. The audio is consumed as transient media by the example Controller, not retained as a recording. The example still advertises only device.describe and camera.capture as remote commands; speech and camera observations are not executable commands.

Source documentation

StreamingTelligence Lab