### Start Session Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Session.md
Demonstrates how to create and start a DeviceSession, and collect its state to add capabilities once started.
```kotlin
val session = Wearables.createSession(AutoDeviceSelector()).getOrElse { error ->
throw IllegalStateException(error.description)
}
session.start()
lifecycleScope.launch {
session.state.collect { state ->
if (state == DeviceSessionState.STARTED) {
// Ready to add capabilities
addStream(session)
}
}
}
```
--------------------------------
### Initialization and session setup
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/dat-conventions/SKILL.md
Demonstrates the basic steps for initializing the SDK, creating a session, and starting a stream.
```kotlin
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)
}
```
--------------------------------
### Add Display Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Session.md
Shows how to attach a display capability to a started session and handle its state changes.
```kotlin
session.start()
lifecycleScope.launch {
session.state.collect { state ->
if (state == DeviceSessionState.STARTED) {
val display = session.addDisplay()
.onSuccess { newDisplay ->
lifecycleScope.launch {
newDisplay.state.collect { displayState ->
if (displayState == DisplayState.STARTED) {
sendContentToDisplay(newDisplay)
}
}
}
}
.onFailure { error, _ ->
Log.e("DAT", "Failed to add display: ${error.description}")
}
}
}
}
```
--------------------------------
### AndroidManifest.xml configuration
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Configure necessary permissions and meta-data in your AndroidManifest.xml.
```xml
```
--------------------------------
### Maven repository configuration
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Add the Meta Wearables Maven repository to your project's settings.gradle.kts file.
```kotlin
val localProperties =
Properties().apply {
val localPropertiesPath = rootDir.toPath() / "local.properties"
if (localPropertiesPath.exists()) {
load(localPropertiesPath.inputStream())
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/facebook/meta-wearables-dat-android")
credentials {
username = ""
password = System.getenv("GITHUB_TOKEN") ?: localProperties.getProperty("github_token")
}
}
}
}
```
--------------------------------
### Session Start and Failure Handling
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/AGENTS.md
Example of starting a session and handling potential failures with error reporting.
```kotlin
}
}
}
}
}
}
.onFailure { error, _ -> showError(error.description) }
}
}
}
session.start()
}
```
--------------------------------
### Starting a Display Session
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/AGENTS.md
Example Kotlin code demonstrating how to create and manage a display session, including error handling and content sending.
```kotlin
import com.meta.wearable.dat.core.Wearables
import com.meta.wearable.dat.core.selectors.SpecificDeviceSelector
import com.meta.wearable.dat.core.session.DeviceSessionState
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.display.Display
import com.meta.wearable.dat.display.addDisplay
import com.meta.wearable.dat.display.types.DisplayState
import com.meta.wearable.dat.display.views.ButtonStyle
import com.meta.wearable.dat.display.views.FlexBoxBackground
import com.meta.wearable.dat.display.views.IconName
import com.meta.wearable.dat.display.views.TextStyle
fun startDisplaySession(selectedDeviceId: DeviceIdentifier) {
if (Wearables.registrationState.value != RegistrationState.REGISTERED) {
showError("Register with Meta AI before starting Display")
return
}
val session =
Wearables.createSession(SpecificDeviceSelector(selectedDeviceId)).fold(
onSuccess = { it },
onFailure = { error, _ ->
if (error == DeviceSessionError.DAT_APP_ON_THE_GLASSES_UPDATE_REQUIRED) {
showDatAppUpdateAction()
}
showError(error.description)
return
},
)
var display: Display? = null
lifecycleScope.launch {
session.errors.collect { error ->
if (error == DeviceSessionError.DAT_APP_ON_THE_GLASSES_UPDATE_REQUIRED) {
showDatAppUpdateAction()
}
showError(error.description)
}
}
lifecycleScope.launch {
session.state.collect { state ->
if (state == DeviceSessionState.STARTED && display == null) {
session.addDisplay()
.onSuccess { newDisplay ->
display = newDisplay
lifecycleScope.launch {
newDisplay.state.collect { displayState ->
setTryItEnabled(displayState == DisplayState.STARTED)
if (displayState == DisplayState.STARTED) {
newDisplay.sendContent {
flexBox(
gap = 12,
padding = 24,
background = FlexBoxBackground.CARD,
) {
text("Bike ride", style = TextStyle.HEADING)
button(
label = "Done",
style = ButtonStyle.PRIMARY,
iconName = IconName.CHECKMARK,
onClick = { showDoneState() },
)
```
--------------------------------
### SDK Initialization
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Initialize the DAT SDK in your Application class.
```kotlin
import com.meta.wearable.dat.core.Wearables
class MyApplication : Application() {
override fun onCreate() {
super.onCreate() Wearables.initialize(this)
.onFailure { error, _ -> error("Failed to initialize DAT: ${error.description}") }
}
}
```
--------------------------------
### SessionViewModel for camera session
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/sample-app-guide/SKILL.md
SessionViewModel handles creating, starting, and managing camera streams.
```kotlin
class SessionViewModel : ViewModel() {
private var session: Session? = null
private var stream: Stream? = null
fun startCameraSession() {
val createdSession = Wearables.createSession(AutoDeviceSelector()).getOrElse {
throw IllegalStateException(error.description)
}
createdSession.start()
session = createdSession
stream = createdSession.addStream(
StreamConfiguration(videoQuality = VideoQuality.MEDIUM, frameRate = 24),
).getOrElse {
throw IllegalStateException(error.description)
}.also {
addedStream ->
addedStream.start().getOrElse {
throw IllegalStateException(error.description)
}
}
}
}
```
--------------------------------
### Complete AndroidManifest.xml Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/configuration.md
An example of a complete AndroidManifest.xml file demonstrating the necessary meta-data tags and permissions for the Meta Wearables DAT SDK.
```xml
```
--------------------------------
### Codex installation using helper script
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/README.md
Alternative installation for Codex using a helper script.
```bash
./install-skills.sh codex
```
--------------------------------
### Start Stream Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Stream.md
Demonstrates how to add a stream to a session, start it, and handle success or failure callbacks.
```kotlin
val stream = session.addStream(
StreamConfiguration(videoQuality = VideoQuality.MEDIUM, frameRate = 24)
).getOrElse {
throw IllegalStateException(it.description)
}
stream.start().onSuccess {
Log.d("DAT", "Stream started, frames incoming")
}.onFailure {
Log.e("DAT", "Failed to start stream: ${it.description}")
}
```
--------------------------------
### Register and create a session
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Register the device and create a new session using AutoDeviceSelector.
```kotlin
import com.meta.wearable.dat.core.Wearables
import com.meta.wearable.dat.core.selectors.AutoDeviceSelector
fun connect(activity: Activity) {
Wearables.startRegistration(activity)
}
fun startSession() {
val session = Wearables.createSession(AutoDeviceSelector()).getOrElse { error ->
throw IllegalStateException(error.description)
}
session.start()
}
```
--------------------------------
### Logging Stream Start Failures
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/debugging/SKILL.md
Example of how to log errors when starting a stream using Kotlin.
```kotlin
private const val TAG = "DATWearables"
stream.start()
.onFailure { error, _ -> Log.e(TAG, "Failed to start stream: ${error.description}") }
```
--------------------------------
### AutoDeviceSelector Examples
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/types.md
Examples demonstrating how to instantiate AutoDeviceSelector with different filtering strategies.
```kotlin
// Any eligible device
AutoDeviceSelector()
// Only display-capable devices
AutoDeviceSelector(filter = { device -> device.isDisplayCapable() })
// Only compatible devices
AutoDeviceSelector(filter = { device ->
device.compatibility == DeviceCompatibility.COMPATIBLE
})
```
--------------------------------
### Other tool installs using helper script
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/README.md
Commands to install other AI tools like Copilot and Cursor using the helper script.
```bash
./install-skills.sh copilot # .github/copilot-instructions.md
./install-skills.sh cursor # .cursor/rules/*.mdc
./install-skills.sh agents # AGENTS.md
./install-skills.sh all # Claude/Codex when available, plus Copilot/Cursor/AGENTS.md
```
--------------------------------
### Complete example with opt-out
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/README.md
An example of AndroidManifest.xml including the application ID and analytics opt-out.
```xml
```
--------------------------------
### MainActivity for registration
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/sample-app-guide/SKILL.md
MainActivity demonstrates collecting registration state and initiating registration.
```kotlin
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
lifecycleScope.launch {
Wearables.registrationState.collect {
// Update registration UI
}
}
}
fun register() {
Wearables.startRegistration(this)
}
}
```
--------------------------------
### Observe registration and device states
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Observe the registration state and available devices using coroutines.
```kotlin
lifecycleScope.launch {
Wearables.registrationState.collect {
state ->
// Update registration UI
}
}
lifecycleScope.launch {
Wearables.devices.collect {
devices ->
// Update the device list
}
}
```
--------------------------------
### Dependency declarations
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Declare the DAT SDK dependencies in your libs.versions.toml and app/build.gradle.kts files.
```toml
[versions]
mwdat = "0.7.0"
[libraries]
mwdat-core = { group = "com.meta.wearable", name = "mwdat-core", version.ref = "mwdat" }
mwdat-camera = { group = "com.meta.wearable", name = "mwdat-camera", version.ref = "mwdat" }
mwdat-mockdevice = { group = "com.meta.wearable", name = "mwdat-mockdevice", version.ref = "mwdat" }
```
```kotlin
dependencies {
implementation(libs.mwdat.core)
implementation(libs.mwdat.camera)
implementation(libs.mwdat.mockdevice)
}
```
--------------------------------
### MockDeviceKit Setup in Tests
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/configuration.md
Code snippet demonstrating how to set up and tear down the MockDeviceKit for testing purposes.
```kotlin
dependencies {
testImplementation(libs.mwdat.mockdevice)
}
```
```kotlin
@Before
fun setUp() {
val mockDeviceKit = MockDeviceKit.getInstance(context)
mockDeviceKit.enable(
MockDeviceKitConfig(initiallyRegistered = true)
)
}
@After
fun tearDown() {
mockDeviceKit.disable()
}
```
--------------------------------
### Add Stream Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Session.md
Illustrates adding a camera stream capability to a started session and handling potential errors.
```kotlin
session.start()
lifecycleScope.launch {
session.state.collect { state ->
if (state == DeviceSessionState.STARTED) {
val stream = session.addStream(
StreamConfiguration(
videoQuality = VideoQuality.MEDIUM,
frameRate = 24,
)
).getOrElse { error ->
Log.e("DAT", "Failed to add stream: ${error.description}")
return@collect
}
stream.start()
}
}
}
```
--------------------------------
### Claude Code installation using helper script
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/README.md
Alternative installation for Claude Code using a helper script.
```bash
./install-skills.sh claude
```
--------------------------------
### Custom URI Scheme Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/configuration.md
Example of a data tag specifying a custom URI scheme for callbacks.
```xml
```
--------------------------------
### Suggested app structure
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/sample-app-guide/SKILL.md
The suggested directory structure for the Android DAT app.
```text
app/src/main/java/com/example/myapp/
├── MyApplication.kt
├── MainActivity.kt
├── session/
│ └── SessionViewModel.kt
└── ui/
├── RegistrationScreen.kt
└── CameraScreen.kt
```
--------------------------------
### Example Test: Video Streaming
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/MockDeviceKit.md
An example test case demonstrating how to test video streaming functionality with MockDeviceKit.
```kotlin
@RunWith(AndroidJUnit4::class)
class StreamingTest : MockDeviceKitTestCase(MainActivity::class.java) {
@Test
fun testVideoStreaming() {
val mockDevice = mockDeviceKit.pairRaybanMeta()
mockDevice.powerOn()
mockDevice.unfold()
mockDevice.don()
// Set up mock video
val videoUri = Uri.parse("file:///android_asset/test_video.h265")
mockDevice.services.camera.setCameraFeed(videoUri)
// Grant permission
mockDeviceKit.permissions.set(Permission.CAMERA, PermissionStatus.Granted)
// Test your streaming code...
val scenario = scenarioRule.scenario
scenario.onActivity { activity ->
// Interact with activity and verify streaming works
}
}
@Test
fun testPermissionDenial() {
val mockDevice = mockDeviceKit.pairRaybanMeta()
mockDevice.powerOn()
mockDevice.unfold()
mockDevice.don()
// Simulate denied permission
mockDeviceKit.permissions.set(Permission.CAMERA, PermissionStatus.Denied)
// Test your error handling...
}
}
```
--------------------------------
### Create a session and attach a stream
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/AGENTS.md
Code snippet demonstrating how to create a session, start it, add a stream with configuration, and start the stream.
```kotlin
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)
}
```
--------------------------------
### Add camera streaming
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/getting-started/SKILL.md
Add camera streaming to the session with specified video quality and frame rate.
```kotlin
import com.meta.wearable.dat.camera.addStream
import com.meta.wearable.dat.camera.types.StreamConfiguration
import com.meta.wearable.dat.camera.types.VideoQuality
val stream = session.addStream(
StreamConfiguration(videoQuality = VideoQuality.MEDIUM, frameRate = 24),
).getOrElse { error ->
throw IllegalStateException(error.description)
}
stream.start().onFailure { error, _ ->
throw IllegalStateException(error.description)
}
```
--------------------------------
### Start Registration
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/permissions-registration/SKILL.md
Initiates the app registration process with Meta AI.
```kotlin
Wearables.startRegistration(activity)
```
--------------------------------
### Example 1: Camera App with Auto Selection
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/DeviceSelector.md
A practical example showing how to create a device session for a camera app using AutoDeviceSelector to automatically select any connected device.
```kotlin
fun createCameraSession(): DeviceSession? {
// Auto-select any connected device
val selector = AutoDeviceSelector()
return Wearables.createSession(selector)
.onSuccess { session ->
session.start()
}
.onFailure { error, _ ->
Log.e("DAT", "Failed to create session: ${error.description}")
}
.getOrNull()
}
```
--------------------------------
### Observe frames and capture photos
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/sample-app-guide/SKILL.md
Code for rendering video stream previews and capturing photos.
```kotlin
viewModelScope.launch {
stream?.videoStream?.collect {
// Render preview
}
}
fun capturePhoto() {
viewModelScope.launch {
stream?.capturePhoto()
?.onSuccess {
savePhoto(it.data)
}
?.onFailure {
showCaptureError(error.description)
}
}
}
```
--------------------------------
### DatResult Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/types.md
Example usage of DatResult for handling session creation outcomes.
```kotlin
Wearables.createSession(selector)
.onSuccess { session ->
session.start()
}
.onFailure { error, statusCode ->
Log.e("DAT", "Failed: ${error.description} (code: $statusCode)")
}
```
--------------------------------
### FlexBox DSL Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Display.md
An example of using the flexBox component within the Display DSL for layout.
```kotlin
flexBox(gap = 12, padding = 24, background = FlexBoxBackground.CARD) {
text("Section")
button(label = "Action", onClick = { handleClick() })
}
```
--------------------------------
### Create a session and attach a stream
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/camera-streaming/SKILL.md
This code snippet demonstrates how to create a session, start it, add a stream with specific video quality and frame rate, and then start the stream.
```kotlin
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)
}
```
--------------------------------
### getInstance
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/MockDeviceKit.md
Gets the singleton MockDeviceKit instance for a context.
```kotlin
fun getInstance(context: Context): MockDeviceKitInterface
```
```kotlin
import com.meta.wearable.dat.mockdevice.MockDeviceKit
import com.meta.wearable.dat.mockdevice.api.MockDeviceKitConfig
val mockDeviceKit = MockDeviceKit.getInstance(context)
```
--------------------------------
### Observe session state
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/AGENTS.md
Creates a session, starts it, and observes its state transitions, reacting to states like STARTED, PAUSED, and STOPPED.
```kotlin
val session = Wearables.createSession(AutoDeviceSelector()).getOrElse {
throw IllegalStateException(error.description)
}
session.start()
lifecycleScope.launch {
session.state.collect { state ->
when (state) {
DeviceSessionState.STARTED -> onStarted()
DeviceSessionState.PAUSED -> onPaused()
DeviceSessionState.STOPPED -> onStopped()
else -> Unit
}
}
}
```
--------------------------------
### Example 2: Display App with Display-Only Devices
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/DeviceSelector.md
A practical example for a display app, using AutoDeviceSelector with a filter to ensure only display-capable devices are selected.
```kotlin
fun createDisplaySession(): DeviceSession? {
// Auto-select display-capable device only
val selector = AutoDeviceSelector(filter = { device ->
device.isDisplayCapable()
})
return Wearables.createSession(selector)
.onSuccess { session ->
session.start()
}
.onFailure { error, _ ->
Log.e("DAT", "Failed to create display session: ${error.description}")
}
.getOrNull()
}
```
--------------------------------
### Codex installation
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/README.md
Commands to install the Codex plugin for Meta Wearables DAT Android.
```bash
git clone https://github.com/facebook/meta-wearables-dat-android.git
cd meta-wearables-dat-android
codex plugin install ./plugins/mwdat-android
```
--------------------------------
### Stop Session Example
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/api-reference/Session.md
Shows how to stop a DeviceSession and clean up associated resources.
```kotlin
fun cleanupSession(session: DeviceSession) {
stream?.stop()
session.stop()
session = null
}
```
--------------------------------
### Sending Video
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/display-access/SKILL.md
Example of how to send a video using VideoPlayer, including handling playback states and errors.
```kotlin
import com.meta.wearable.dat.display.types.VideoCodec
import com.meta.wearable.dat.display.types.VideoPlayerState
import com.meta.wearable.dat.display.types.VideoSource
import com.meta.wearable.dat.display.views.VideoPlayer
import kotlinx.coroutines.Job
private var videoStateJob: Job? = null
private var videoErrorJob: Job? = null
lifecycleScope.launch {
val currentDisplay = display ?: return@launch
val player = VideoPlayer(
source = VideoSource.Url("https://example.com/tutorial.mp4"),
codec = VideoCodec.MP4,
)
videoStateJob?.cancel()
videoErrorJob?.cancel()
videoStateJob = launch {
player.state.collect {
if (state == VideoPlayerState.ENDED) {
videoStateJob?.cancel()
videoStateJob = null
sendStatusCard(currentDisplay)
}
}
}
videoErrorJob = launch {
player.error.collect {
if (error != null) {
showError(error.description)
}
}
}
currentDisplay.sendContent { video(player = player) }
.onSuccess { player.play() }
.onFailure { error, _ -> showError(error.description) }
}
```
--------------------------------
### Manifest Placeholders in build.gradle.kts
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/_autodocs/configuration.md
Example of setting manifest placeholders for application ID and client token for development and production environments.
```kotlin
android {
productFlavors {
create("dev") {
dimension = "environment"
manifestPlaceholders["mwdat_application_id"] = "0"
manifestPlaceholders["mwdat_client_token"] = "dev-token"
}
create("prod") {
dimension = "environment"
manifestPlaceholders["mwdat_application_id"] = "YOUR_PROD_ID"
manifestPlaceholders["mwdat_client_token"] = "YOUR_PROD_TOKEN"
}
}
}
```
--------------------------------
### Device Picker UI Logic
Source: https://github.com/facebook/meta-wearables-dat-android/blob/main/plugins/mwdat-android/skills/display-access/SKILL.md
Example of collecting device metadata and updating the UI for a device picker.
```kotlin
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()
private val devicesMetadata = MutableStateFlow