audio-streaming
Receive synchronized PCM audio frames through a Camera stream on Android
Kotlin patterns, DatResult, session and capability conventions for DAT SDK Android development
$ npx -y skills add facebook/meta-wearables-dat-android --skill dat-conventions --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dat-conventionsContext preview
The summary Claude sees to decide when to auto-load this skill.
Kotlin patterns, DatResult, session and capability conventions for DAT SDK Android development
name: dat-conventions description: Kotlin patterns, DatResult, session and capability conventions for DAT SDK Android development
| Task | Command | |------|---------| | Build app | `./gradlew assembleDebug` | | Run tests | `./gradlew test` | | Install app | `./gradlew installDebug` | | Lint app | `./gradlew lint` |
The SDK is organized into four public modules:
`DeviceSession.start()` is fire-and-forget and returns `Unit`; capabilities can only be attached once the session reports `DeviceSessionState.STARTED`.
Wearables.initialize(context)
Wearables.createSession(AutoDeviceSelector()).fold(
onSuccess = { session ->
lifecycleScope.launch {
session.state.collect { state ->
if (state == DeviceSessionState.STARTED) {
session.addCamera(StreamConfiguration()).fold(
onSuccess = { camera ->
camera.stream.start().onFailure { error, _ ->
showError(error.description)
}
},
onFailure = { error, _ -> showError(error.description) },
)
}
}
}
lifecycleScope.launch {
session.errors.collect { error -> showError(error.description) }
}
session.start()
},
onFailure = { error, _ -> showError(error.description) },
)Wearables.checkPermissionStatus(Permission.CAMERA)
.onSuccess { status -> /* handle status */ }
.onFailure { error, _ -> /* handle error */ }Avoid `getOrThrow()` in user-facing samples. Surface typed errors from `DatResult` instead.
| Type | Purpose | Example | |------|---------|---------| | `DeviceSession` | Device connection lifecycle | `Wearables.createSession(...)` | | `Camera` | Camera capability on a session | `session.addCamera(...)` | | `Stream` | Video stream from a camera | `camera.stream` | | `Display` | Display capability on a session | `session.addDisplay(...)` | | `*Selector` | Device targeting | `AutoDeviceSelector`, `SpecificDeviceSelector` | | `*Error` | Typed failure surface | `DeviceSessionError`, `StreamError`, `CaptureError` |
If your editor supports remote MCP servers, connect `https://mcp.developer.meta.com/wearables` and use `search_dat_docs` for current DAT setup, session lifecycle, camera streaming, MockDeviceKit, permissions, and exact API symbols. This public docs server does not require authentication; do not configure tokens, OAuth, or custom authorization headers for it.
See the `dat-docs-mcp` skill for client setup and troubleshooting. Use `llms.txt` when your tool only supports static reference context.
val mockDeviceKit = MockDeviceKit.getInstance(context)
mockDeviceKit.enable()
mockDeviceKit.pairGlasses(GlassesModel.RAYBAN_META).fold(
onSuccess = { device -> onMockDevicePaired(device) },
onFailure = { error, _ -> showError(error.description) },
)Use MockDeviceKit to drive registration, device availability, streaming media, and permission scenarios without physical hardware.
The Meta Wearables Device Access Toolkit enables developers to utilize Meta's AI glasses to build hands-free wearable experiences into their mobile applications.
Receive synchronized PCM audio frames through a Camera stream on Android
Capture standalone high-quality photos from connected glasses on Android
Session and Stream capability setup, video frames, photo capture, resolution and frame rate configuration
Use the Wearables DAT MCP server for live DAT documentation search with `search_dat_docs`, Muse Code, Claude Code, Codex, Cursor,…
Common issues, Developer Mode, version compatibility, and session and stream diagnosis
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback