Phone → send messages & files
Purpose
Show how the phone pushes text, binary blobs, notifications, and APKs to the glasses over classic Bluetooth and Wi‑Fi P2P.
Entry points
Phone home:
MainPhoneActivity→SendMessageActivity
Sample screen:
com.rokid.phone.SendMessageActivity
Platform
- Phone
Main file
Capabilities surfaced
- P2P text
- P2P file payloads
- BT text lanes
- BT file lanes
- System notification bridging
- APK distribution through P2P
Notes on flow
Text
- Direct:
sendTextMessageByP2P("...", "GlassSample") - BT:
sendTextMessageByClassicBT("...", "GlassSample")
Files
- P2P:
getFileOperater().sendFile(...) - BT backup:
getBtFileOperater().sendFile(...)
Notifications
- Compose
NotificationMessage getAbsNotificationService()?.sendNotification(...)
APK push
getApkFileOperator()?.sendFile(...)wired toTransferProgressListener.
FAQs
Choosing BT vs Direct
Control bursts and terse strings → BT suffices. Imagery/APKs/large assets → prioritize P2P.
Origin of mocked assets on disk
Activities copy seeded files from assets/ into cache before transmitting.
Caveats
- APK transfer refuses to proceed until P2P is hot.
- Sample
clientIdisGlassSample— hoist to config for production bundles.