Skip to content
Skillv1.0.0

glance-widget

Design, implement, review, debug, and test Android home-screen app widgets with Jetpack Glance following Google's official Android guidance. Use for GlanceAppWidget, GlanceAppWidgetReceiver, widget UI

by MihaiCristianCondrea(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from MihaiCristianCondrea/App-Toolkit-for-Android (.agents/skills/glance-widget/SKILL.md). Install upstream with npx skills add MihaiCristianCondrea/App-Toolkit-for-Android --skill glance-widget. Copyright stays with the author.

Android Glance Widget

Follow Google's official Jetpack Glance guidance.

The references/ directory contains local copies of the official Google documentation used by this skill.

Treat those files as read-only reference material:

  • Do not edit, rewrite, summarize into, reformat, or otherwise modify them.
  • Do not fetch the same documentation again when the local reference already exists.
  • Read only the reference files relevant to the current task.
  • Prefer the local references over general architectural assumptions or memory.
  • If the local documentation does not cover a question, consult the official Android documentation only when additional verification is actually needed.

Core rules

  • Use Glance APIs for widget UI. Do not assume regular Jetpack Compose UI elements are directly interoperable with Glance.
  • Keep GlanceAppWidget stateless and passive; keep durable application state in the application's source of truth and use Glance state only for widget-specific state when appropriate.
  • Update widgets intentionally when data/state changes. Use persistent scheduling only when the update must outlive the current process/lifecycle.
  • Use Glance action APIs for widget interaction.
  • Respect AppWidget/RemoteViews limitations even when the API looks Compose-like.
  • Prefer the smallest implementation supported by the official guidance.

Reference routing

Read:

  • references/create-app-widget.md for initial widget setup, receiver, manifest/provider metadata, sizing modes, and basic creation.
  • references/enhance.md for widget picker name/description and optional experience improvements.
  • references/configuration.md for configuration activities and reconfiguration.
  • references/generated-previews.md for Android 15+ generated previews and preview fallbacks.
  • references/pin-in-app.md for requesting widget pinning from inside the app.
  • references/error-handling.md for composition errors, fallback layouts, and custom error handling.
  • references/testing.md for Glance unit testing, matchers, context, and size.
  • references/user-interaction.md for clicks, activities, services, broadcasts, callbacks, and action parameters.
  • references/metrics.md for widget interaction/event metrics.
  • references/glance-app-widget.md for widget state, updates, update timing, update, updateAll, updateIf, and background update work.
  • references/build-ui.md for layouts, components, responsive sizing, and Glance UI construction.
  • references/theme.md for GlanceTheme, colors, Material interop, and widget styling.
  • references/interoperability.md for AndroidRemoteViews and XML/ RemoteViews interoperability.
  • references/additional-resources.md for official samples, demos, design resources, and API references.

Workflow

  1. Inspect the existing widget, receiver, provider XML, manifest registration, state/update path, and relevant app data source.
  2. Identify the Glance topic involved.
  3. Read the matching official reference before changing behavior.
  4. Follow existing project conventions unless they conflict with the official Glance contract.
  5. Make the smallest complete change.
  6. Add or update tests when widget behavior being changed is testable with the Glance testing APIs.
  7. Do not introduce regular Compose UI APIs into Glance code merely because both use @Composable.

Review

Check for:

  • regular Compose UI APIs mixed into Glance without supported interoperability;
  • incorrect receiver/provider/manifest setup;
  • in-memory widget state relied on as durable state;
  • missing or excessive widget updates;
  • unsupported interaction patterns;
  • sizing/layout assumptions that ignore widget host sizes;
  • configuration, preview, pinning, or error behavior that contradicts the corresponding official guide;
  • missing relevant Glance tests.

When uncertain, read the relevant official reference rather than guessing.

Official source index

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/mihaicristiancondrea-app-toolkit-for-android-glance-widget/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

mihaicristiancondrea-app-toolkit-for-android-glance-widget.ocm.jsonjson
{
  "ocm": "1",
  "id": "mihaicristiancondrea-app-toolkit-for-android-glance-widget",
  "kind": "skill",
  "name": "glance-widget",
  "description": "Design, implement, review, debug, and test Android home-screen app widgets with Jetpack Glance following Google's official Android guidance. Use for GlanceAppWidget, GlanceAppWidgetReceiver, widget UI, sizing, state and updates, actions, configuration, previews, pinning, error handling, testing, metrics, themes, or RemoteViews interoperability.",
  "publisher": "MihaiCristianCondrea",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "glance",
      "glance-app-widget",
      "app-widget",
      "home-screen-widget",
      "glanceappwidget",
      "glanceappwidgetreceiver",
      "jetpack",
      "compose",
      "widget"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Design, implement, review, debug, and test Android home-screen app widgets with Jetpack Glance following Google's official Android guidance. Use for GlanceAppWidget, GlanceAppWidgetReceiver, widget UI, sizing, state and updates, actions, configuration, previews, pinning, error handling, testing, metrics, themes, or RemoteViews interoperability."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/MihaiCristianCondrea/App-Toolkit-for-Android",
      "path": ".agents/skills/glance-widget/SKILL.md",
      "ref": "427582184a66dff41cf5a85c589ff020c0bfdbd8",
      "url": "https://github.com/MihaiCristianCondrea/App-Toolkit-for-Android/blob/427582184a66dff41cf5a85c589ff020c0bfdbd8/.agents/skills/glance-widget/SKILL.md",
      "key": "MihaiCristianCondrea/App-Toolkit-for-Android/.agents/skills/glance-widget/SKILL.md"
    }
  },
  "instructions": "# Android Glance Widget\n\nFollow Google's official Jetpack Glance guidance.\n\nThe `references/` directory contains local copies of the official Google\ndocumentation used by this skill.\n\nTreat those files as read-only reference material:\n\n- Do not edit, rewrite, summarize into, reformat, or otherwise modify them.\n- Do not fetch the same documentation again when the local reference already exists.\n- Read only the reference files relevant to the current task.\n- Prefer the local references over general architectural assumptions or memory.\n- If the local documentation does not cover a question, consu",
  "cost": {
    "context_tokens": 1342
  }
}

Fetch it by URL: GET /api/v1/registry/mihaicristiancondrea-app-toolkit-for-android-glance-widget/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.