You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -11,7 +11,9 @@ A real-time AI assistant for Meta Ray-Ban smart glasses. See what you see, hear
11
11
12
12

13
13
14
-
Built on [Meta Wearables DAT SDK](https://github.com/facebook/meta-wearables-dat-ios) + [Gemini Live API](https://ai.google.dev/gemini-api/docs/live) + [OpenClaw](https://github.com/nichochar/openclaw) (optional).
14
+
Built on [Meta Wearables DAT SDK](https://github.com/facebook/meta-wearables-dat-ios) (iOS) / [DAT Android SDK](https://github.com/nichochar/openclaw) (Android) + [Gemini Live API](https://ai.google.dev/gemini-api/docs/live) + [OpenClaw](https://github.com/nichochar/openclaw) (optional).
15
+
16
+
**Supported platforms:** iOS (iPhone) and Android (Pixel, Samsung, etc.)
Open `samples/CameraAccessAndroid/` in Android Studio.
184
+
185
+
### 2. Configure GitHub Packages (DAT SDK)
186
+
187
+
The Meta DAT Android SDK is distributed via GitHub Packages. You need a GitHub Personal Access Token with `read:packages` scope.
188
+
189
+
1. Go to [GitHub > Settings > Developer Settings > Personal Access Tokens](https://github.com/settings/tokens) and create a **classic** token with `read:packages` scope
190
+
2. In `samples/CameraAccessAndroid/local.properties`, add:
191
+
192
+
```properties
193
+
github_token=YOUR_GITHUB_TOKEN
194
+
```
195
+
196
+
> **Tip:** If you have the `gh` CLI installed, you can run `gh auth token` to get a valid token. Make sure it has `read:packages` scope -- if not, run `gh auth refresh -s read:packages`.
197
+
>
198
+
> **Note:** GitHub Packages requires authentication even for public repositories. The 401 error means your token is missing or invalid.
199
+
200
+
### 3. Add your secrets
201
+
202
+
```bash
203
+
cd samples/CameraAccessAndroid/app/src/main/java/com/meta/wearable/dat/externalsampleapps/cameraaccess/
204
+
cp Secrets.kt.example Secrets.kt
205
+
```
206
+
207
+
Edit `Secrets.kt` with your [Gemini API key](https://aistudio.google.com/apikey) (required) and optional OpenClaw/WebRTC config.
208
+
209
+
### 4. Build and run
210
+
211
+
1. Let Gradle sync in Android Studio (it will download the DAT SDK from GitHub Packages)
212
+
2. Select your Android phone as the target device
213
+
3. Click Run (Shift+F10)
214
+
215
+
> **Wireless debugging:** You can also install via ADB wirelessly. Enable **Wireless debugging** in your phone's Developer Options, then pair with `adb pair <ip>:<port>`.
216
+
217
+
### 5. Try it out
218
+
219
+
**Without glasses (Phone mode):**
220
+
1. Tap **"Start on Phone"** -- uses your phone's back camera
221
+
2. Tap the **AI button** (sparkle icon) to start a Gemini Live session
222
+
3. Talk to the AI -- it can see through your phone camera
223
+
224
+
**With Meta Ray-Ban glasses:**
225
+
226
+
Enable Developer Mode in the Meta AI app (same steps as iOS above), then:
227
+
1. Tap **"Start Streaming"** in the app
228
+
2. Tap the **AI button** for voice + vision conversation
229
+
230
+
---
231
+
168
232
## Setup: OpenClaw (Optional)
169
233
170
234
OpenClaw gives Gemini the ability to take real-world actions: send messages, search the web, manage lists, control smart home devices, and more. Without it, Gemini is voice + vision only.
@@ -194,22 +258,30 @@ In `~/.openclaw/openclaw.json`:
194
258
```
195
259
196
260
Key settings:
197
-
-`bind: "lan"` -- exposes the gateway on your local network so your iPhone can reach it
261
+
-`bind: "lan"` -- exposes the gateway on your local network so your phone can reach it
198
262
-`chatCompletions.enabled: true` -- enables the `/v1/chat/completions` endpoint (off by default)
199
-
-`auth.token` -- the token your iOS app will use to authenticate
200
-
201
-
### 2. Configure the iOS app
263
+
-`auth.token` -- the token your app will use to authenticate
202
264
203
-
In `GeminiConfig.swift`, update the OpenClaw settings:
265
+
### 2. Configure the app
204
266
267
+
**iOS** -- In `Secrets.swift`:
205
268
```swift
206
-
staticlet openClawHost ="http://Your-Mac.local"// your Mac's Bonjour hostname
269
+
staticlet openClawHost ="http://Your-Mac.local"
207
270
staticlet openClawPort =18789
208
-
staticlet openClawGatewayToken ="your-gateway-token-here"// must match gateway.auth.token
-**iOS iPhone mode**: Uses `.voiceChat` audio session for echo cancellation + mic gating during AI speech
343
+
-**iOS Glasses mode**: Uses `.videoChat` audio session (mic is on glasses, speaker is on phone -- no echo)
344
+
-**Android**: Uses `VOICE_COMMUNICATION` audio source for built-in acoustic echo cancellation
250
345
251
346
### Video Pipeline
252
347
253
-
-**Glasses**: DAT SDK `videoFramePublisher` (24fps) -> throttle to ~1fps -> JPEG (50% quality) -> Gemini
254
-
-**iPhone**: `AVCaptureSession` back camera (30fps) -> throttle to ~1fps -> JPEG -> Gemini
348
+
-**Glasses**: DAT SDK video stream (24fps) -> throttle to ~1fps -> JPEG (50% quality) -> Gemini
349
+
-**Phone**: Camera capture (30fps) -> throttle to ~1fps -> JPEG -> Gemini
255
350
256
351
### Tool Calling
257
352
258
-
Gemini Live supports function calling. This app declares a single `execute` tool that routes everything through OpenClaw:
353
+
Gemini Live supports function calling. Both apps declare a single `execute` tool that routes everything through OpenClaw:
259
354
260
355
1. User says "Add eggs to my shopping list"
261
356
2. Gemini speaks "Sure, adding that now" (verbal acknowledgment before tool call)
@@ -265,25 +360,52 @@ Gemini Live supports function calling. This app declares a single `execute` tool
265
360
6. Result returns to Gemini via `toolResponse`
266
361
7. Gemini speaks the confirmation
267
362
363
+
---
364
+
268
365
## Requirements
269
366
367
+
### iOS
270
368
- iOS 17.0+
271
369
- Xcode 15.0+
272
370
- Gemini API key ([get one free](https://aistudio.google.com/apikey))
273
371
- Meta Ray-Ban glasses (optional -- use iPhone mode for testing)
274
372
- OpenClaw on your Mac (optional -- for agentic actions)
275
373
374
+
### Android
375
+
- Android 14+ (API 34+)
376
+
- Android Studio Ladybug or newer
377
+
- GitHub account with `read:packages` token (for DAT SDK)
378
+
- Gemini API key ([get one free](https://aistudio.google.com/apikey))
379
+
- Meta Ray-Ban glasses (optional -- use Phone mode for testing)
380
+
- OpenClaw on your Mac (optional -- for agentic actions)
381
+
382
+
---
383
+
276
384
## Troubleshooting
277
385
278
-
**"Gemini API key not configured"** -- Open `GeminiConfig.swift` and add your API key.
386
+
### General
387
+
388
+
**Gemini doesn't hear me** -- Check that microphone permission is granted. The app uses aggressive voice activity detection -- speak clearly and at normal volume.
279
389
280
-
**OpenClaw connection timeout** -- Make sure your iPhone and Mac are on the same Wi-Fi network, the gateway is running (`openclaw gateway restart`), and the hostname in `GeminiConfig.swift` matches your Mac's Bonjour name.
390
+
**OpenClaw connection timeout** -- Make sure your phone and Mac are on the same Wi-Fi network, the gateway is running (`openclaw gateway restart`), and the hostname matches your Mac's Bonjour name.
391
+
392
+
**OpenClaw opens duplicate browser tabs** -- This is a known upstream issue in OpenClaw's CDP (Chrome DevTools Protocol) connection management ([#13851](https://github.com/nichochar/openclaw/issues/13851), [#12317](https://github.com/nichochar/openclaw/issues/12317)). Using `profile: "openclaw"` (managed Chrome) instead of the default extension relay may improve stability.
393
+
394
+
### iOS-specific
395
+
396
+
**"Gemini API key not configured"** -- Add your API key in Secrets.swift or in the in-app Settings.
281
397
282
398
**Echo/feedback in iPhone mode** -- The app mutes the mic while the AI is speaking. If you still hear echo, try turning down the volume.
283
399
284
-
**Gemini doesn't hear me** -- Check that microphone permission is granted. The app uses aggressive voice activity detection -- speak clearly and at normal volume.
400
+
### Android-specific
401
+
402
+
**Gradle sync fails with 401 Unauthorized** -- Your GitHub token is missing or doesn't have `read:packages` scope. Check `local.properties` for `gpr.user` and `gpr.token`. Generate a new token at [github.com/settings/tokens](https://github.com/settings/tokens).
403
+
404
+
**Gemini WebSocket times out** -- The Gemini Live API sends binary WebSocket frames. If you're building a custom client, make sure to handle both text and binary frame types.
405
+
406
+
**Audio not working** -- Ensure `RECORD_AUDIO` permission is granted. On Android 13+, you may need to grant this permission manually in Settings > Apps.
285
407
286
-
**OpenClaw opens duplicate browser tabs** -- This is a known upstream issue in OpenClaw's CDP (Chrome DevTools Protocol) connection management ([#13851](https://github.com/nichochar/openclaw/issues/13851), [#12317](https://github.com/nichochar/openclaw/issues/12317)). The browser control service loses track of existing tabs after navigation, falling back to opening new ones. Using `profile: "openclaw"` (managed Chrome) instead of the default extension relay may improve stability.
408
+
**Phone camera not starting** -- Ensure `CAMERA` permission is granted. CameraX requires both the permission and a valid lifecycle.
287
409
288
410
For DAT SDK issues, see the [developer documentation](https://wearables.developer.meta.com/docs/develop/) or the [discussions forum](https://github.com/facebook/meta-wearables-dat-ios/discussions).
A sample Android application demonstrating integration with Meta Wearables Device Access Toolkit. This app showcases streaming video from Meta AI glasses, capturing photos, and managing connection states.
4
+
5
+
## Features
6
+
7
+
- Connect to Meta AI glasses
8
+
- Stream camera feed from the device
9
+
- Capture photos from glasses
10
+
- Share captured photos
11
+
12
+
## Prerequisites
13
+
14
+
- Android Studio Arctic Fox (2021.3.1) or newer
15
+
- JDK 11 or newer
16
+
- Android SDK 31+ (Android 12.0+)
17
+
- Meta Wearables Device Access Toolkit (included as a dependency)
18
+
- A Meta AI glasses device for testing (optional for development)
19
+
20
+
## Building the app
21
+
22
+
### Using Android Studio
23
+
24
+
1. Clone this repository
25
+
1. Open the project in Android Studio
26
+
1. Add your personal access token (classic) to the `local.properties` file (see [SDK for Android setup](https://wearables.developer.meta.com/docs/getting-started-toolkit/#sdk-for-android-setup))
27
+
1. Click **File** > **Sync Project with Gradle Files**
28
+
1. Click **Run** > **Run...** > **app**
29
+
30
+
## Running the app
31
+
32
+
1. Turn 'Developer Mode' on in the Meta AI app.
33
+
1. Launch the app.
34
+
1. Press the "Connect" button to complete app registration.
35
+
1. Once connected, the camera stream from the device will be displayed
36
+
1. Use the on-screen controls to:
37
+
- Capture photos
38
+
- View and save captured photos
39
+
- Disconnect from the device
40
+
41
+
## Troubleshooting
42
+
43
+
For issues related to the Meta Wearables Device Access Toolkit, please refer to the [developer documentation](https://wearables.developer.meta.com/docs/develop/) or visit our [discussions forum](https://github.com/facebook/meta-wearables-dat-android/discussions)
44
+
45
+
## License
46
+
47
+
This source code is licensed under the license found in the LICENSE file in the root directory of this source tree.
0 commit comments