mcpbeat

Sample App Guide

facebook/meta-wearables-dat-android-sample-app-guide

Building a complete DAT app with session creation, camera streaming, and photo capture

805 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
339
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/facebook/meta-wearables-dat-android --skill sample-app-guide

The instruction itself

8 sections, as written by the author

Sample App Guide (Android)

Build an Android DAT app with registration, sessions, camera streaming, and photo capture.

Pair this with the CameraAccess sample.

Project setup

  • Create an Android Studio app project.
  • Add the DAT Maven repository and dependencies.
  • Configure AndroidManifest.xml for registration callbacks plus APPLICATION_ID and CLIENT_TOKEN.
  • Initialize Wearables in your Application.

Suggested app structure

app/src/main/java/com/example/myapp/
├── MyApplication.kt
├── MainActivity.kt
├── session/
│   └── SessionViewModel.kt
└── ui/
    ├── RegistrationScreen.kt
    └── CameraScreen.kt

Registration and session creation

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        lifecycleScope.launch {
            Wearables.registrationState.collect { state ->
                // Update registration UI
            }
        }
    }

    fun register() {
        Wearables.startRegistration(this)
    }
}
class SessionViewModel : ViewModel() {
    private var session: Session? = null
    private var camera: Camera? = null

    fun startCameraSession() {
        val createdSession = Wearables.createSession(AutoDeviceSelector()).getOrElse { error ->
            throw IllegalStateException(error.description)
        }
        createdSession.start()
        session = createdSession

        camera = createdSession.addCamera(
            StreamConfiguration(videoQuality = VideoQuality.MEDIUM, frameRate = 24),
        ).getOrElse { error ->
            throw IllegalStateException(error.description)
        }.also { addedCamera ->
            addedCamera.stream.start().getOrElse { error ->
                throw IllegalStateException(error.description)
            }
        }
    }
}

Observe frames and capture photos

viewModelScope.launch {
    camera?.stream?.videoStream?.collect { frame ->
        // Render preview
    }
}

fun capturePhoto() {
    viewModelScope.launch {
        camera?.stream?.capturePhoto()
            ?.onSuccess { photoData ->
                savePhoto(photoData.data)
            }
            ?.onFailure { error, _ ->
                showCaptureError(error.description)
            }
    }
}

Shutdown

fun stopCameraSession() {
    camera?.stop()
    session?.stop()
    camera = null
    session = null
}

Testing with MockDeviceKit

Use MockDeviceKit to simulate linking glasses, permission state, and camera media without physical hardware. See MockDevice Testing for setup details.

How to use it

Copy the folder

Take facebook/meta-wearables-dat-android-sample-app-guide from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.