Wear OS Compose & Hardware Inputs ⌚
Building for the wrist comes with entirely new constraints regarding battery life, input mechanisms, and screen real estate.
⚡ When to Use
- When asked to build a Wear OS companion app or standalone watch app.
🏗️ Core Rules / Pillars
1. Wear Compose Dependencies
- Pattern: Standard compose material will look incorrect and tiny on Wear OS. ALWAYS use
androidx.wear.compose:compose-materialorcompose-material3specifically meant for watches. - Implementation: Instead of
Scaffold, useScaffoldfrom the Wear OS library which includes aTimeTextandPositionIndicator.
2. Rotary Input (Crown support)
- Pattern: Scrolling lists MUST support the physical rotating crown on the watch.
- Implementation: Combine
ScalingLazyColumnwith.rotaryScrollable()modifier to capture hardware scroll events continuously.
🚧 Critical Anti-Hallucination Guards
- Trap: Do not hallucinate massive long-running background workers for Wear OS! Always use Google Play Services
DataClientorMessageClientto safely proxy network requests to the attached phone to save watch battery life.