Demonstrates building Wear Widgets using Remote Compose for Wear OS.
Wear Widgets are partial-height, vertically scrolling surfaces that complement apps and watch faces, providing effortless access to information and key actions. They leverage Remote Compose, featuring a declarative DSL similar to Jetpack Compose.
This sample includes:
- HelloWidget: A simple "Hello World" widget.
- WeatherWidget: A widget that displays dynamic content based on stored state.
Wear Widgets are compatible with Wear OS 4 and above. On devices where native widgets are not supported, the library automatically translates them and makes them available to the system as a Tile.
This sample uses the Gradle build system. To build this project, use the
./gradlew build command or import it into Android Studio.
./gradlew :app:installDebugTo test how your widget translates to a full-screen Tile on older Wear OS versions, you can inject it directly into the system carousel using ADB.
1. Add the tile:
adb shell am broadcast \
-a com.google.android.wearable.app.DEBUG_SURFACE \
--es operation add-tile \
--ecn component com.google.example.wear_widget/.HelloWidgetServiceNote: The preceding command adds a FULLSCREEN tile by default. You can also
specify LARGE and SMALL sizes by passing --ei type [0|1|2] to the command
(where type 0 is FULLSCREEN). Depending on the device state, app-triggered
content updates via triggerUpdate() might not reflect on screen for LARGE
and SMALL widget sizes due to a known platform bug. This issue only affects
developers during testing; a fix is coming in a future release.
2. Show the tile:
adb shell am broadcast \
-a com.google.android.wearable.app.DEBUG_SYSUI \
--es operation show-tile \
--ei index 0The HelloWidget is a simple, static widget designed to show the minimal
implementation required for a Wear Widget.
To preview it on a device or emulator, follow the steps in the Add and Preview your Widget section above.
The WeatherWidget demonstrates how to handle dynamic content updates. You can
trigger updates in two ways:
The sample includes a WeatherActivity that acts as a control panel.
- Launch the Weather Update app from the app launcher on your watch.
- Tap any of the weather condition buttons (Sunny, Cloudy, etc.) to push that state to the widget.
You can simulate external data updates (like a background sync) by sending a broadcast intent via ADB.
adb shell am broadcast \
-a com.google.example.wear_widget.UPDATE_WEATHER \
-n com.google.example.wear_widget/.WeatherUpdateReceiver \
--ei temp 75 \
--es condition "'🌧️'"Note: Depending on your terminal and OS, you may need to escape the emoji or use its unicode representation.
- Stack Overflow: https://stackoverflow.com/questions/tagged/wear-os
If you've found an error in this sample, please file an issue: https://github.com/android/wear-os-samples
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.

