What problem does it solve?
Managing Meta glasses device sessions is non-trivial because the device controls when a session starts, pauses, resumes, and stops, so apps must react correctly to avoid broken streaming, wasted work, or resource leaks.
Core Features & Use Cases
- Session state management: Understand and handle
idle, starting, started, paused, stopping, and stopped with appropriate app behavior.
- Observing session changes: Process session updates via an async stream (e.g.,
stateStream()) so UI and work react to real device transitions.
- Capability/stream lifecycle alignment: Track stream state transitions on a started device session and respond to changes like paused vs stopped.
- Device availability monitoring: Use device availability streams to start new sessions only when the glasses are connectable, and avoid assuming automatic restarts after re-availability.
Quick Start
Create a session, start it, and listen to session.stateStream() to update your UI and pause work when you receive .paused and to release resources only when you receive .stopped.