# Glance Appwidget Updates And Memory

Manages Android AppWidget state updates, background syncs, and RemoteViews bitmap...

- Repository: https://github.com/android/skills (10219 stars)
- Category: Design
- License: Complete terms in LICENSE.txt
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add android/skills --skill glance-appwidget-updates-and-memory -g -a claude-code -y`
Codex: `npx skills add android/skills --skill glance-appwidget-updates-and-memory -g -a codex -y`
Cursor: `npx skills add android/skills --skill glance-appwidget-updates-and-memory -g -a cursor -y`
Gemini CLI: `npx skills add android/skills --skill glance-appwidget-updates-and-memory -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add android/skills`

## Description

Manages Android AppWidget state updates, background syncs, and RemoteViews bitmap memory limits with Jetpack Glance (androidx.glance:glance-appwidget) and AppWidgetProvider receivers on Android 17 (API 37). Use this skill when configuring Android 17 (API level 37) compileSdk/targetSdk and AndroidManifest.xml widget receivers, refreshing frozen or stale Glance widget UI after CoroutineWorker DataStore preference updates (updateAppWidgetState), downsampling images within the WindowMetrics memory limit for SizeMode.Responsive, SizeMode.Exact, or LazyColumn, sharing content:// URIs with FileProvider, or fixing ActionCallback NoSuchMethodException and AppWidgetProvider ForegroundServiceStartNotAllowedException crashes with WorkManager. Don't use for Glance layout templates (suggest the glance-canonical-layouts skill) or in-app Compose screens.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

This skill provides guidance for managing state updates and keeping Android
AppWidgets that use Jetpack Glance (`androidx.glance:glance-appwidget`) or
`RemoteViews` within the Android 17 widget bitmap memory limits. For widget UI
layout templates, suggest the `glance-canonical-layouts` skill.

- When configuring a Glance widget, see [Create an app widget with Glance](references/android/develop/ui/compose/glance/create-app-widget.md).
- When targeting Android 17 (`targetSdk = 37`), see [Android 17 widget memory limits](references/android/about/versions/17/behavior-changes-17.md).
- When maintaining a classic `AppWidgetProvider`, see [Create an app widget](references/android/develop/ui/views/appwidgets/index.md).

## Prerequisites

- Kotlin Android project (`minSdk >= 26`) with `compileSdk = 37` (`targetSdk = 37` when targeting Android 17) in `build.gradle.kts`.
- Jetpack Glance (`1.2.0`, minimum `1.1.1+`) and the Compose compiler Gradle plugin enabled on the module.

## Critical mandates

The rest: https://github.com/android/skills/blob/HEAD/system/glance-appwidget-updates-and-memory/SKILL.md
