# 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

- [SendMessageActivity.kt](https://gitee.com/as_pixar/glass3sdkdemo/blob/main/glass3sdkphonedemo/app/src/main/java/com/rokid/phone/SendMessageActivity.kt)

## 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 to `TransferProgressListener`.

## 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 `clientId` is `GlassSample` — hoist to config for production bundles.  
