Learn Kotlin conventions, result handling, and session patterns for DAT SDK Android.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "dat-conventions" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/meta-wearables-dat-android/main/plugins/mwdat-android/skills/dat-conventions/SKILL.md 2. Save it as ~/.claude/skills/dat-conventions/SKILL.md 3. Reload skills and tell me it's ready
Explain the design of DatResult in the DAT SDK Android, how to handle success and failure branches, and provide a concise Kotlin example.
A tutorial describing DatResult structure, handling patterns, and Kotlin sample code.
Summarize the session management conventions in the DAT SDK Android, including initialization, lifecycle handling, error recovery, and thread-safety advice, and turn them into a developer checklist.
An actionable session management checklist covering key conventions and cautions.
Explain capability integration conventions in the DAT SDK Android, including naming patterns, invocation flow, result handling, and a recommended Kotlin wrapper template.
A capability integration guide with a recommended Kotlin wrapper template.
| 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:
Wearables.initialize(context)
val session = Wearables.createSession(AutoDeviceSelector()).getOrElse { error ->
throw IllegalStateException(error.description)
}
session.start()
val stream = session.addStream(StreamConfiguration()).getOrElse { error ->
throw IllegalStateException(error.description)
}
stream.start().getOrElse { error ->
throw IllegalStateException(error.description)
}
DatResult<T, E> for typed success and failure handlingStateFlow and FlowSession first, then attach capabilities such as Stream or DisplayWearables.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 |
|---|---|---|
Session | Device connection lifecycle | Wearables.createSession(...) |
Stream | Camera capability on a session | session.addStream(...) |
Display | Display capability on a session | session.addDisplay(...) |
*Selector | Device targeting | AutoDeviceSelector |
*Error | Typed failure surface | SessionError, StreamError |
Wearables — SDK entry pointSession — lifecycle for an interaction with a linked deviceStream — camera capability attached to a sessionDisplay — display capability attached to a sessionStreamConfiguration — video quality and frame rate configurationMockDeviceKit — simulated device environment for testingIf your editor supports remote MCP servers, connect https://mcp.facebook.com/wearables_dat and use search_dat_docs for current DAT setup, session lifecycle, camera streaming, MockDeviceKit, permissions, and exact API symbols.
Use llms.txt when your tool only supports static reference context.
val mockDeviceKit = MockDeviceKit.getInstance(context)
mockDeviceKit.enable()
val device = mockDeviceKit.pairRaybanMeta()
Use MockDeviceKit to drive registration, device availability, streaming media, and permission scenarios without physical hardware.
Wearables.initialize(context)DatResult failures from createSession, start, addStream, addDisplay, or capturePhotoSet up camera sessions, stream video, capture photos, and tune resolution.
Build a complete DAT app with sessions, camera streaming, and photo capture.
Manage session and stream state with pause, resume, and device monitoring.
Diagnose common issues, compatibility problems, and session or stream debugging cases.
Helps developers set up Meta AI app registration and device permission flows.
Build display-enabled interfaces with device selection, UI components, and media playback.
Learn Swift conventions, naming, and async patterns for DAT SDK iOS development.
Apply idiomatic Kotlin patterns to build robust, efficient, maintainable applications.
Build a complete DAT app with camera streaming and photo capture.
Learn practical Kotlin Coroutines and Flow patterns for Android and KMP.
Learn practical Kotlin Ktor server patterns for building and testing backend apps.
Securely develop and generate code for enterprise Kotlin Android projects.