Skip to content

Classic Bluetooth scan & connect

Purpose

Show how the phone app scans for Glass 3 devices, lists peers, and launches the classic Bluetooth handshake.

Entry points

Phone home:

  • Tap add device from MainPhoneActivity.

Sample screen:

  • com.rokid.phone.ui.classicbt.ui.ClassicBtActivity

Platform

  • Phone

Main files

Flow

  1. Ensure system Bluetooth is powered on.
  2. After entering the scan UI, call startScanBt.
  3. ViewModel events stream results back to Compose / UI.
  4. When the user taps a row, remember which device is pending.
  5. Navigate to the unified pairing hub BtWifiConnectActivity.

Notes for developers

Why pairing is not finished here

This page only discovers + selects peers. Connection and P2P follow-up are centralized in BtWifiConnectActivity so Bluetooth and P2P pairing do not each implement their own duplicated state machine.

What you are listing

Classic Bluetooth devices — not raw BLE advertisements.

Caveats

  • If BT is off, the flow guides the user through enabling it.
  • On exit, animations / loading states are cleared.
  • If discovery returns nothing, navigation routes to a dedicated “not found” helper screen.