AI Skill Report Card

Building Mobile Widgets

A-82·Mar 17, 2026·Source: Web
YAML
--- name: building-mobile-widgets description: Builds native iOS and Android widgets with proper lifecycle management, data handling, and platform-specific UI patterns. Use when creating home screen widgets, app extensions, or glanceable interfaces. ---

Mobile Widget Builder

15 / 15

iOS Widget (Swift/WidgetKit):

SWIFT
import WidgetKit import SwiftUI struct SimpleWidget: Widget { let kind: String = "SimpleWidget" var body: some WidgetConfiguration { StaticConfiguration(kind: kind, provider: Provider()) { entry in SimpleWidgetEntryView(entry: entry) } .configurationDisplayName("My Widget") .description("Shows important data at a glance") .supportedFamilies([.systemSmall, .systemMedium]) } } struct SimpleWidgetEntryView: View { var entry: Provider.Entry var body: some View { VStack { Text(entry.title) .font(.headline) Text(entry.value) .font(.caption) .foregroundColor(.secondary) } .padding() } }

Android Widget (Kotlin):

KOTLIN
class SimpleWidgetProvider : AppWidgetProvider() { override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { for (appWidgetId in appWidgetIds) { updateAppWidget(context, appWidgetManager, appWidgetId) } } } private fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManager, appWidgetId: Int) { val views = RemoteViews(context.packageName, R.layout.simple_widget) views.setTextViewText(R.id.widget_title, "Widget Title") views.setTextViewText(R.id.widget_value, "Current Value") appWidgetManager.updateAppWidget(appWidgetId, views) }
Recommendation
Add specific data provider implementation examples for iOS TimelineProvider to make the Quick Start more complete
13 / 15

iOS Widget Development

Progress:

  • Create widget extension target in Xcode
  • Define TimelineProvider for data updates
  • Build SwiftUI views for each widget family
  • Configure widget sizes and display name
  • Test on device and simulator
  • Handle background refresh limits

Android Widget Development

Progress:

  • Create AppWidgetProvider class
  • Define widget metadata in XML
  • Create RemoteViews layout
  • Handle update intervals and user interactions
  • Add widget to manifest
  • Test across different Android versions

Cross-Platform Considerations

Progress:

  • Design consistent visual language
  • Adapt to platform-specific constraints
  • Plan data sync strategy
  • Test update frequencies
  • Optimize for battery usage
Recommendation
Include concrete update frequency recommendations with actual numbers (e.g., 'update every 15 minutes for weather data')
18 / 20

Example 1: Weather Widget Input: Display current temperature and conditions Output:

  • iOS: Small widget showing "72°F" with weather icon
  • Android: 2x1 widget with temperature, condition text, and location

Example 2: Task Counter Input: Show remaining tasks from productivity app Output:

  • iOS: Medium widget with task count and progress ring
  • Android: 4x1 widget with task list and completion percentages

Example 3: Stock Tracker Input: Display portfolio value and change Output:

  • iOS: Large widget with multiple stock prices and charts
  • Android: Scrollable widget with stock symbols and price changes
Recommendation
Provide template code for handling widget configuration activities and user preferences

iOS Widgets:

  • Use Timeline entries efficiently (max 100 per day)
  • Design for all supported families simultaneously
  • Implement placeholder states for loading
  • Use App Intents for iOS 16+ interactivity
  • Test with reduced motion and accessibility settings

Android Widgets:

  • Minimize RemoteViews complexity for performance
  • Use PendingIntents for user interactions
  • Handle configuration activities properly
  • Support both light and dark themes
  • Test across different launcher apps

Universal:

  • Keep data fresh but respect battery life
  • Design for glanceability (5-second rule)
  • Use consistent branding across platforms
  • Plan for network failures and offline states
  • Optimize images and assets for widget sizes

iOS:

  • Don't try to update widgets too frequently (timeline limits)
  • Don't use complex animations or video content
  • Don't assume widgets are always visible
  • Don't ignore memory constraints

Android:

  • Don't create overly complex RemoteViews hierarchies
  • Don't ignore launcher-specific widget behavior
  • Don't assume consistent update intervals
  • Don't forget to handle widget removal cleanup

General:

  • Don't make widgets too information-dense
  • Don't ignore platform UI guidelines
  • Don't use widgets for critical user actions
  • Don't assume users will configure widgets properly
0
Grade A-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
15/15
Workflow
13/15
Examples
18/20
Completeness
18/20
Format
15/15
Conciseness
13/15