What Are Android Widgets?
Android widgets shipped with Android 1.5 in 2009 — long before iOS widgets. They run in the launcher process, not your app. Your app supplies a RemoteViews tree (a serializable description of the UI), the launcher inflates and renders it, and clicks are bridged back to your app via broadcast intents.
Android 12 (Material You) gave them a major refresh: rounded corners, dynamic color, snap-to-grid sizing, and easier APIs via Jetpack Glance.
App Widgets vs Jetpack Glance
App Widgets (classic)
XML layouts + RemoteViews + AppWidgetProvider. Works on every Android version. Verbose but maximally flexible.
Jetpack Glance
A Compose-flavored DSL that compiles to RemoteViews. Recommended for new widgets — much less code, modern APIs, easier theming, and works with Material You dynamic color.
Glance for Wear OS Tiles
Same Glance API powers Wear OS tiles, so you get a watch widget and a phone widget from one codebase.
Widget Sizes & Resizing
Since Android 12 you declare a target cell size (in dp) and a list of supported sizes; the launcher resizes the widget by snapping to its grid. Use SizeF arrays in AppWidgetProviderInfo or Glance's SizeMode.Responsive to render different layouts at different sizes — small, medium, large.
Resizable
Set resizeMode="horizontal|vertical" so the user can drag the widget edges.
Min/target dp
Use targetCellWidth and targetCellHeight (12+) for clean snapping; minWidth and minHeight as the fallback for older devices.
Max sizes
maxResizeWidth and maxResizeHeight let you cap the upper bound for very tall layouts.
Lock-screen sizes
Lock-screen widgets render smaller and tinted; design specifically for the smaller surface.
How Widgets Update
updatePeriodMillisinAppWidgetProviderInfo— but the system clamps to once per 30 minutes minimum, even if you set less.- Manual updates: call
AppWidgetManager.getInstance(ctx).updateAppWidget(id, views)whenever your data changes. - WorkManager: schedule periodic work (15 min minimum) and refresh widgets when it runs.
- Push: use FCM to wake the app, fetch fresh data, and update the widget.
- User interaction:
onAppWidgetOptionsChangedfires when the user resizes; perfect time to re-render.
Interactivity & Lists
Android widgets have always been more interactive than iOS widgets. You can:
- Wire buttons to PendingIntents to launch activities, services, or broadcasts.
- Use
RemoteViewsService+RemoteViewsFactoryto back aListVieworGridViewinside a widget. - Use
setOnClickPendingIntentat the row level for taps inside lists. - Glance maps these to
actionStartActivity,actionRunCallback, and a Compose-styleLazyColumn.
Android Widgets vs iOS Widgets
Android wins on
Interactivity (buttons everywhere, scrolling lists), resizing (user drag), and theming via Material You dynamic color.
iOS wins on
Visual consistency (every widget gets the same chrome), lock-screen integration, StandBy mode, and tighter sizing per device.
Both share
A "snapshot" mental model — widgets are not live videos. They are periodically rendered slices of state.
Pick by use case
Persistent ambient info → widget. Real-time event → ongoing notification on Android, Live Activity on iOS.
See our iOS Widgets guide for the iOS half.
Widgets vs Ongoing Notifications
Use a widget for ambient info the user might want anytime (weather, calendar, stocks, todos). Use an ongoing notification (often paired with a foreground service) for real-time, ephemeral, event-driven info — navigation, music, ride tracking, calls.