Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

glance-appwidget-updates-and-memory

Skill by android

Manages Android AppWidget state updates, background syncs, and RemoteViews bitmap memory limits for Jetpack Glance and AppWidgetProvider widgets on Android 17 (API 37). Written for Android developers maintaining home screen widgets in Kotlin projects.

  • Score 94
  • 11k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install glance-appwidget-updates-and-memory

Built from the published package, never by AI.

git clone --depth 1 https://github.com/android/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/system/glance-appwidget-updates-and-memory ~/.claude/skills/glance-appwidget-updates-and-memory

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install glance-appwidget-updates-and-memory in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill guides Android developers who manage AppWidget state updates, background syncs, and RemoteViews bitmap memory limits. It covers widgets built with Jetpack Glance (androidx.glance:glance-appwidget) and classic AppWidgetProvider receivers, targeting Android 17 (API 37). The source covers configuring compileSdk and targetSdk, registering widget receivers in AndroidManifest.xml, and refreshing Glance UI after DataStore updates with updateAppWidgetState.

The skill explains how to estimate the widget bitmap memory cap from WindowMetrics and downsample images for SizeMode.Responsive, SizeMode.Exact, and LazyColumn. It recommends passing in-memory bitmaps over FileProvider content URIs. It also covers WorkManager fixes for ActionCallback and ForegroundServiceStartNotAllowedException crashes. For layout templates, the source points to the glance-canonical-layouts skill instead.

Written from the project's SKILL.md and checked against it.

What it can do

  • Widget memory cap estimateEstimates the RemoteViews bitmap memory cap from the window bounds on API 30+ with a fallback to display metrics.
  • Two-stage image downsamplingDownsamples images to widget dimensions and then to a per-image byte ceiling before decoding.
  • Glance state refreshTriggers GlanceAppWidget.update or updateAll after updateAppWidgetState changes DataStore preferences.
  • Manifest and receiver setupGuides registering GlanceAppWidgetReceiver and widget info XML in AndroidManifest.xml.
  • FileProvider sharingDescribes exposing downsampled cache images through a content:// URI when a widget must use one.
  • Full widget updatesAdvises calling AppWidgetManager.updateAppWidget instead of partiallyUpdateAppWidget when replacing images.
  • Crash fixesCovers fixes for ActionCallback NoSuchMethodException and ForegroundServiceStartNotAllowedException with WorkManager.

What you need

  • Kotlin Android project with minSdk 26 or higher
  • compileSdk 37 set in build.gradle.kts
  • Jetpack Glance 1.2.0 (minimum 1.1.1)
  • Compose compiler Gradle plugin enabled on the module

Try asking

  • Help me refresh my Glance widget after DataStore preferences change
  • Downsample this image to fit my widget's memory cap on Android 17
  • Set up a GlanceAppWidgetReceiver in my AndroidManifest.xml

Good to know

  • The memory cap is computed once at boot and is not exposed in a public API.
  • Content URIs are decoded at full resolution by the launcher, so downsample the file first.
  • On targetSdk 37, bitmap-backed Icons count toward the cap.
  • FileProvider URI grants fail when a work-profile widget sits on a personal home screen.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: system/glance-appwidget-updates-and-memory/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md22 KB
  • references/AndroidManifest.xml1 KB
  • references/ClassicWidgetImageUpdater.kt2 KB
  • references/FeedCollectionGlanceWidget.kt2 KB
  • references/SampleGlanceWidget.kt4 KB
Show all 13 files
  • references/WidgetBitmapUtils.kt4 KB
  • references/WidgetStateAndActions.kt2 KB
  • references/android/about/versions/17/behavior-changes-17.md24 KB
  • references/android/develop/ui/compose/glance/create-app-widget.md22 KB
  • references/android/develop/ui/views/appwidgets/index.md10 KB
  • references/proguard-rules.pro98 B
  • references/res/xml/file_paths.xml117 B
  • references/res/xml/sample_widget_info.xml307 B

Alternatives to glance-appwidget-updates-and-memory

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

glance-appwidget-updates-and-memory: common questions

What memory limit applies to Android 17 widget images?

The source says system_server computes a RemoteViews bitmap cap of 6 * width * height bytes once at boot. It recommends downsampling each image to the widget's target size and dividing the cap by the number of distinct bitmaps.

Should I pass widget images as bitmaps or content URIs?

The source recommends in-memory bitmaps through ImageProvider(bitmap) or RemoteViews.setImageViewBitmap by default. Content URIs are a fallback for widgets that must pass a content:// URI.

Does this skill cover Glance layout design?

No. The source says layout templates are out of scope and suggests the glance-canonical-layouts skill for them.

How do I install glance-appwidget-updates-and-memory?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is glance-appwidget-updates-and-memory free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is glance-appwidget-updates-and-memory safe to use?

It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to glance-appwidget-updates-and-memory?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

glance-appwidget-updates-and-memory Install

Add to stack

Loading.