Skip to content

Demo Running Guide

The Demo projects help developers understand how the phone side and glasses side work together. Run the Demo first, then jump into scenario samples or API references. If you want to watch the full flow first, see the Build an app in five minutes video.

Get the Demo Repository

Demo repository:

https://gitee.com/as_pixar/glass3sdkdemo

Clone it locally:

bash
git clone https://gitee.com/as_pixar/glass3sdkdemo.git

The project structure, build commands, and source paths below are based on this repository.

Project Structure

The Demo repository contains two independent Android projects:

  • glassdemo: glasses-side Demo
  • glass3sdkphonedemo: phone-side Demo

Open and build them separately.

Environment

  • Android Studio
  • JDK 17
  • Android SDK 34
  • Android phone
  • Rokid Glass 3 device

Build Commands

Build the Glasses Demo

bash
cd glassdemo
./gradlew assembleDebug

Build the Phone Demo

bash
cd glass3sdkphonedemo
./gradlew assembleDebug

First Debugging Tips

Run the phone-side Demo first, then run the glasses-side Demo.

Phone entry:

  • com.rokid.phone.ui.MainPhoneActivity

Glasses entry:

  • com.rokid.glass.HomeActivity

Before Running

Authentication parameters

UserAuthInfo("", "") in phone-side MainPhoneActivity is a placeholder. If online capabilities require real AK/SK values, fill in the authentication parameters first.

Permissions

On first run, grant the required permissions, especially:

  • Bluetooth
  • Wi-Fi / Nearby
  • Camera
  • Microphone
  • Notification listener
  • Storage

The following capabilities depend on real devices and real links:

  • Bluetooth connection
  • Wi-Fi P2P
  • Video stream preview
  • Notification sync
  • OTA
  • Ring connection

Run the Demo

Run the glasses Demo

  1. Connect the glasses to your computer with the Glass3 data debug cable.
  2. Confirm Android Studio recognizes the device, such as Rokid RG-glasses.
  3. Select the glasses app module.
  4. Run glassdemo on the glasses.

Run glasses Demo

Run the phone Demo

  1. Connect an Android phone to your computer.
  2. Select the phone app module.
  3. Install and start the phone Demo.
  4. Scan and connect to Glass3 from the phone Demo.

After classic Bluetooth connects the phone and glasses demos, they can exchange messages and files.

Phone Demo connected

Verify basic capabilities

Recommended verification order:

StepCapabilityExpected result
1SDK initializationPhone and glasses initialize successfully.
2Bluetooth scan and connectionPhone can scan and connect to Glass3.
3MessagingPhone and glasses can exchange text messages.
4File transferSmall files can be transferred between phone and glasses.
5P2P connectionLarge files or AV features can use the P2P channel.
6MediaPhoto, video, or live preview can be triggered.

If Bluetooth or P2P fails, see:

Next Step