wear-widgets
What it does
This skill guides building, migrating and checking Wear OS widgets that use Glance Wear and Remote Compose. It covers the widget classes, layout elements and state. It is for Android developers building widgets on smartwatches.
When to use it
- ✓When you want to build a Wear OS widget with Glance Wear and Remote Compose.
- ✓When you need to migrate a Wear OS tile to a widget.
- ✓When your watch widget needs button actions or changing local state.
Skill link
https://github.com/android/skills/blob/main/wear/wear-widgets/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Create a Wear OS widget that shows my next calendar event and a button to mark it done.”
5 new skills a week. 1 minute to read.
How it works
The skill resolves the latest library versions, sets the SDK and Compose requirements, and then builds the widget service and UI. It also adds click actions and local state for the widget.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Wear OS widgets use androidx.glance.wear (GlanceWearWidget and
GlanceWearWidgetService) with androidx.compose.remote (Remote Compose).
They serialize declarative UI and state documents to the watch host process.
Prerequisites and setup
Resolve library versions : Resolve the latest versions for
{GLANCE_WEAR_VERSION}(androidx.glance.wear),{COMPOSE_REMOTE_VERSION}(androidx.compose.remote), and{WEAR_COMPOSE_REMOTE_VERSION}(androidx.wear.compose.remote). Include-alpha,-beta, or-rcreleases when no stable version exists yet. Don't run./gradlew dependenciesto resolve versions:- Use an available dependency lookup tool if present.
- Otherwise, fetch the latest version from Google Maven metadata (Glance Wear metadata, Compose Remote metadata, Wear Compose Remote metadata).
SDK and Compose compiler requirements : Ask permission before modifying repo-wide Gradle files unless the user requested widget creation, tile migration, or dependency setup. Set
compileSdk = 37or higher and enablebuildFeatures { compose = true }. Keep the project's existing Android and Kotlin Gradle plugin declarations intact.dependencies { implementation("androidx.glance.wear:wear:{GLANCE_WEAR_VERSION}") implementation("androidx.glance.wear:wear-core:{GLANCE_WEAR_VERSION}") implementation("androidx.glance.wear:wear-tooling-preview:{GLANCE_WEAR_VERSION}") implementation("androidx.compose.remote:remote-creation-compose:{COMPOSE_REMOTE_VERSION}") implementation("androidx.compose.remote:remote-creation:{COMPOSE_REMOTE_VERSION}") implementation("androidx.compose.remote:remote-core:{COMPOSE_REMOTE_VERSION}") implementation("androidx.compose.remote:remote-tooling-preview:{COMPOSE_REMOTE_VERSION}") implementation("androidx.wear.compose.remote:remote-material3:{WEAR_COMPOSE_REMOTE_VERSION}") }
Codebase exploration
- Search the module for existing
TileService,Material3TileService, orGlanceWearWidgetimplementations,<service>entries inapp/src/main/AndroidManifest.xml, and@drawable/preview assets underapp/src/main/res/. - When migrating an existing tile or modifying an unfamiliar multi-module project, run
./gradlew :app:assembleDebugto verify baseline build health.
Workflow
Step 1: Configure AndroidManifest.xml and provider XML
Register the GlanceWearWidgetService subclass in
app/src/main/AndroidManifest.xml with the BIND_TILE_PROVIDER permission and
BIND_WIDGET_PROVIDER intent action. Attach <meta-data> pointing to an
@xml/ <wearwidget-provider> resource with SMALL and LARGE <container>
entries. When configuring the service, provider XML, or legacy TileService
migration, you MUST follow Widget service and manifest reference.
<service
android:name=".snippets.widget.skill.MyWidgetService"
android:exported="true"
android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER">
<intent-filter>
<action android:name="androidx.glance.wear.action.BIND_WIDGET_PROVIDER" />
</intent-filter>
<meta-data
android:name="androidx.glance.wear.widget.provider"
android:resource="@xml/my_widget_info" />
</service>
Step 2: Implement GlanceWearWidget and GlanceWearWidgetService
Extend GlanceWearWidget and override provideWidgetData returning
WearWidgetDocument. Annotate the GlanceWearWidgetService subclass with
@AssociateWithGlanceWearWidget for static provider resolution:
// WRONG: Mobile GlanceAppWidget API (don't use on Wear OS)
class BrokenWidget : GlanceAppWidget() {
override suspend fun provideGlance(context: Context, id: GlanceId) {}
}
// CORRECT: Wear OS GlanceWearWidget + GlanceWearWidgetService
@AssociateWithGlanceWearWidget(MyWidget::class)
class MyWidgetService : GlanceWearWidgetService() {
override val widget: GlanceWearWidget = MyWidget()
}
class MyWidget : GlanceWearWidget() {
override suspend fun provideWidgetData(
context: Context,
params: WearWidgetParams,
): WearWidgetData =
WearWi
FAQ
Will it change my Gradle files on its own?
It asks permission before changing repo-wide Gradle files, unless you asked for widget creation or dependency setup.
How does it find library versions?
It uses an available lookup tool or the official Google Maven metadata, rather than running dependency commands.
Does it support alpha or beta releases?
Yes. If no stable version exists yet, the skill may use an alpha, beta or release candidate.
Details
Original description by the author
Create, migrate, update, and verify Wear OS widgets using Glance Wear and Remote Compose in an Android project. Use this skill when implementing GlanceWearWidget, GlanceWearWidgetService, WearWidgetDocument, Remote Compose UI primitives (RemoteColumn, RemoteRow, RemoteBox, RemoteText, RemoteImage, RemoteButton), local state with rememberMutableRemoteInt and valueChange, click actions with pendingIntentAction, widget provider XML containers (SMALL and LARGE), rectangular widget picker PNG previews, or migrating legacy ProtoLayout TileService tiles to Wear OS widgets. Don't use for mobile home s
repo: android/skills
Popularity
- GitHub stars
- 10k
- Ranking position
- #11940
- License
- Apache-2.0
- Updated
- 10/29/2026
Comments
- …
More skills from this repository
agp-9-upgrade
10kHelps your agent upgrade an Android app to Android Gradle Plugin 9 and work through its breaking changes. Not for multiplatform projects.
camerax
10kHelps your agent build Android camera features with CameraX, including video recording, hardware controls, ML Kit and Media3 effects.
android-for-cars-parked-apps
10kHelps your agent adapt an Android video, game or browser app to run as a parked app on Android Auto and Android Automotive.
appfunctions
10kHelps your agent find key workflows in an Android app and expose them as AppFunctions that AI agents and voice commands can run.
Similar skills
android-clean-architecture
280kMakes your agent organize Android projects efficiently. It structures the code to make maintenance and new feature development easier.
compose-multiplatform-patterns
280kHelps your agent use Compose Multiplatform and Jetpack Compose patterns in KMP projects, covering state, navigation, theming, and performance.
dart-flutter-patterns
280kMakes your agent write code for Dart and Flutter apps. It uses modern patterns to create robust and manageable apps.