audio-streaming
Receive synchronized PCM audio frames through a Camera stream on Android
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
$ npx -y skills add facebook/meta-wearables-dat-android --skill display-access --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/display-accessContext preview
The summary Claude sees to decide when to auto-load this skill.
Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
name: display-access description: Display capability setup, display-capable device selection, UI DSL, icons, buttons, images, and video playback
Use `mwdat-display` to render content on Meta Ray-Ban Display glasses.
Use this skill with `getting-started` and `permissions-registration` when creating a full app. A Display app still needs SDK initialization, app registration, Android permissions, and DAT manifest metadata before it can create a session.
In `libs.versions.toml`:
[libraries]
mwdat-display = { group = "com.meta.wearable", name = "mwdat-display", version.ref = "mwdat" }In `app/build.gradle.kts`:
dependencies {
implementation(libs.mwdat.core)
implementation(libs.mwdat.display)
}Display apps need the same core DAT setup as other apps:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.INTERNET" />
<application ...>
<meta-data
android:name="com.meta.wearable.mwdat.APPLICATION_ID"
android:value="${mwdat_application_id}" />
<meta-data
android:name="com.meta.wearable.mwdat.CLIENT_TOKEN"
android:value="${mwdat_client_token}" />
</application>Set `mwdat_application_id` and `mwdat_client_token` from Gradle manifest placeholders or `local.properties`, as in the DisplayAccess sample. Developer Mode builds can use the developer registration flow, but production builds need real Wearables Developer Center credentials.
Request the runtime permissions before initializing DAT, then call `Wearables.initialize(context)` once and start observing SDK state. Start registration with `Wearables.startRegistration(activity)`, collect `Wearables.registrationState`, collect `Wearables.registrationErrorStream`, and wait for `RegistrationState.REGISTERED` before creating a display session. Use `Wearables.startUnregistration(activity)` when the user disconnects the app.
Display content only works on connected, compatible devices whose type supports display. Use the public device filter when you want automatic selection:
import com.meta.wearable.dat.core.Wearables
import com.meta.wearable.dat.core.selectors.AutoDeviceSelector
val selector = AutoDeviceSelector(filter = { device -> device.isDisplayCapable() })
val sessionResult = Wearables.createSession(selector)Use `SpecificDeviceSelector(selectedDeviceId)` instead when your UI lets the user pick a specific `DeviceIdentifier` from `Wearables.devices`.
For device picker UI, mirror the DisplayAccess sample: collect `Wearables.devices`, start a metadata collection for each device ID from `Wearables.devicesMetadata[id]`, remove metadata for devices that disappear, and show device name, `device.deviceType.description`, `device.linkState`, `device.compatibility`, and `device.isDisplayCapable()`. Keep selection disabled unless the device is `LinkState.CONNECTED` and display-capable, and surface `DeviceCompatibility.DEVICE_UPDATE_REQUIRED` with an `openFirmwareUpdate` action.
import com.meta.wearable.dat.core.types.Device
import com.meta.wearable.dat.core.types.DeviceIdentifier
import com.meta.wearable.dat.core.types.LinkState
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.update
private val metadataJobs = mutableMapOf<DeviceIdentifier, Job>()
private val devicesMetadata = MutableStateFlow<Map<DeviceIdentifier, Device>>(emptyMap())
lifecycleScope.launch {
Wearables.devices.collect { deviceIds ->
(metadataJobs.keys - deviceIds).forEach { removedId ->
metadataJobs.remove(removedId)?.cancel()
devicesMetadata.update { current -> current - removedId }
}
deviceIds.forEach { id ->
metadataJobs.getOrPut(id) {
launch {
Wearables.devicesMetadata[id]?.collect { device ->
devicesMetadata.update { current -> current + (id to device) }
updateDeviceRow(
id = id,
name = device.name,
type = device.deviceType.description,
isConnected = device.linkState == LinkState.CONNECTED,
isDisplayCapable = device.isDisplayCapable(),
compatibility = device.compatibility,
)
}
}
}
}
}
}If `Wearables.createSession(...)` fails with `DeviceSessionError.DAT_APP_ON_THE_GLASSES_UPDATE_REQUIRED`, show a DAT glasses app update action that calls `Wearables.openDATGlassesAppUpdate(activity)`.
Add the Display capability only after the `DeviceSession` reaches `DeviceSessionState.STARTED`. Keep the sample app pattern of showing a "preparing" state after session start and enabling user content only once the Display capability reports `DisplayState.STARTED`.
import androidx.lifecycle.lifecycleScope import com.meta.wearable.dat.core.Wearables import com.meta.wearable.dat.core.types.DeviceIdentifier import com.meta.wearable.dat.core.types.DeviceSessionError import com.meta.wearable.dat.core.types.RegistrationState import com.meta.wearable.dat.core.session.DeviceSession import com.meta.wearable.dat.core.session.DeviceSessionState import com.meta.wearable.dat.core.selectors.SpecificDeviceSelector import com.meta.wearable.dat.display.Display import com.meta.wearable.dat.display.addDisplay import com.meta.wearable.dat.display.removeDisplay import com.meta.wearable.dat.display.types.DisplayState import kotlinx.coroutines.launch private var display: Display? = null fun startDisplaySession(selectedDeviceId: Dev
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
Kotlin patterns, DatResult, session and capability conventions for DAT SDK Android development
Use the Wearables DAT MCP server for live DAT documentation search with `search_dat_docs`, Muse Code, Claude Code, Codex, Cursor,…