Help us improve
Share bugs, ideas, or general feedback.
From mwdat-android
Sets up camera streaming sessions on Android devices using Meta Wearables SDK. Provides frame reception, photo capture, and resolution/frame rate configuration.
npx claudepluginhub facebook/meta-wearables-dat-android --plugin mwdat-androidHow this skill is triggered — by the user, by Claude, or both
Slash command
/mwdat-android:camera-streamingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use a `Session` and attached `Stream` to receive frames and capture photos.
Implements camera streaming and photo capture for iOS using the DAT SDK. Covers stream configuration, video frame handling, and photo capture.
Guides building an Android DAT app with registration, camera sessions, streaming, and photo capture using Meta Wearables SDK.
Add IMU and GPS sensor data to Meta Display Glasses webapps via Web APIs. For motion tracking, compass, level tool, step counter, shake detection, head tracking, or location.
Share bugs, ideas, or general feedback.
Use a Session and attached Stream to receive frames and capture photos.
Wearables.createSession(...)session.addStream(...)import com.meta.wearable.dat.camera.Stream
import com.meta.wearable.dat.camera.addStream
import com.meta.wearable.dat.camera.types.StreamConfiguration
import com.meta.wearable.dat.camera.types.VideoQuality
import com.meta.wearable.dat.core.Wearables
import com.meta.wearable.dat.core.selectors.AutoDeviceSelector
val session = Wearables.createSession(AutoDeviceSelector()).getOrElse { error ->
throw IllegalStateException(error.description)
}
session.start()
val stream: Stream = session.addStream(
StreamConfiguration(
videoQuality = VideoQuality.MEDIUM,
frameRate = 24,
),
).getOrElse { error ->
throw IllegalStateException(error.description)
}
stream.start().getOrElse { error ->
throw IllegalStateException(error.description)
}
| Quality | Size |
|---|---|
VideoQuality.HIGH | 720 x 1280 |
VideoQuality.MEDIUM | 504 x 896 |
VideoQuality.LOW | 360 x 640 |
Valid values: 2, 7, 15, 24, 30 FPS.
Lower resolution and frame rate usually produce better visual quality per frame over Bluetooth.
StreamState transitions: STOPPED -> STARTING -> STARTED -> STREAMING -> STOPPING -> STOPPED -> CLOSED
lifecycleScope.launch {
stream.state.collect { state ->
when (state) {
StreamState.STREAMING -> {
// Frames are flowing
}
StreamState.STOPPED -> {
// Streaming ended
}
StreamState.CLOSED -> {
// Stream fully closed
}
else -> Unit
}
}
}
lifecycleScope.launch {
stream.videoStream.collect { frame ->
updatePreview(frame)
}
}
lifecycleScope.launch {
stream.capturePhoto()
.onSuccess { photoData ->
val imageBytes = photoData.data
savePhoto(imageBytes)
}
.onFailure { error, _ ->
showCaptureError(error.description)
}
}
Stop the stream when you no longer need camera data, then stop the parent session if the device interaction is finished.
stream.stop()
session.stop()
If you want to remove the capability entirely before re-adding it, call session.removeStream().