Code Once, Pin Everywhere: Multiplatform Widgets for Android & iOS - Andrea Della Porta

Code Once, Pin Everywhere: Multiplatform Widgets for Android & iOS - Andrea Della Porta

🎙 Andrea Della Porta 👥 230K 📅 October 13, 2026 ⏱ 50 min 👁 24 📄 expert opinion 🧭 2026-10-13
Available in: English (current) Français

Keywords

widgetscross-platformKMPGlanceWidgetKit

Summary

In this 50-minute conference talk from NDC Oslo, Andrea Della Porta, a mobile manager at Capgemini, addresses the challenge of building home screen widgets for both Android and iOS without duplicating all the logic. He argues that while widgets are small, they traditionally require two separate implementations: data fetching, domain models, update policy, and glue code. The talk proposes using Kotlin Multiplatform (KMP) to share the core logic (~90%) while keeping only the native UI (10%) for each platform. He demonstrates this with a live football scores app called MatchPin, where a single Kotlin core drives both a Glance widget on Android and a WidgetKit widget on iOS. The speaker explains the architectural seam: a shared repository exposes both a reactive flow for the app and a snapshot method for the widget, while an expect/actual pattern handles the redraw trigger. He also covers critical constraints: iOS WidgetKit requires SwiftUI and cannot use Compose Multiplatform because the system archives the view tree; iOS widgets have limited refresh budgets (40-70 per day) and a memory ceiling of around 30 MB; Android has similar limitations with update intervals. The talk concludes with practical advice on when and how to share widget logic, emphasizing that a widget is a snapshot, not an app, and that the native side should remain as thin as possible.

220 words

Critical Evaluation

Value of the Information & Strength of the Argument

The talk provides high value by offering a concrete, tested solution to a common problem. The speaker backs his claims with real-world examples, open-source apps, and a live demo. He clearly explains the trade-offs and honestly presents the limitations imposed by the platforms. The argumentation is solid: he systematically breaks down the duplication points, shows the seam, and then dives into the ‘messy truths’ that developers will encounter, including specific numbers for refresh budgets and memory limits. His reasoning is structured and evidence-based, making a convincing case that sharing widget logic is not only possible but often advisable, provided the native UI is kept native.

Scientific Rigor, Source Quality, Title Accuracy

The scientific rigor is strong. The speaker references official documentation (e.g., Apple’s 40-70 refreshes, Android’s 15-30 min intervals) and mentions observed crash logs for the memory limit, which he clearly labels as observed rather than documented. He also cites examples of open-source apps that already use this pattern. However, he does not provide direct links to these references during the talk, and the only sources listed in the YouTube description are the conference websites. The title is perfectly matched with the content, as the talk is exactly about writing code once and using it for both platform widgets. The presentation is well-structured, with code examples and a live demo, supporting his points with practical evidence.

235 words

Title / Content Match

The title accurately reflects the content: the speaker demonstrates how to write once and use for both Android and iOS widgets, sharing all logic while keeping native UIs.

Quality & Reliability

8/10

The talk is based on practical experience and real code, with specific numbers from platform documentation and observed crash logs. Some figures (e.g., 30 MB memory limit) are observed but not officially documented, which slightly lowers the absolute reliability.

Key Moments

Cited Sources

Concurring Sources

  • Apple WidgetKit Documentation — Confirms iOS widget architecture and refresh budgets.
  • Android Glance Documentation — Confirms Android widget development with Compose-based Glance.
  • Kotlin Multiplatform Official Guide — Supports the concept of sharing logic across platforms.
  • Touchlab Sky GitHub — Provides the tool for bridging Kotlin flows to Swift, as mentioned in the talk.

Contribution & Novelties

This talk fills a gap by narrating a working pattern for sharing widget logic across Android and iOS via Kotlin Multiplatform. The speaker demonstrates that the majority of widget functionality (data, domain, update policy) is shareable, while only the final pixels are platform-specific. He provides a decision framework and highlights pitfalls like app groups, refresh budgets, and memory limits. This is a practical, actionable guide for developers.

Pour aller plus loin :

  • Apple WidgetKit Documentation — Official reference for iOS widgets, including constraints and refresh mechanisms.
  • Android Glance Documentation — Jetpack Glance for building Android app widgets with Compose.
  • Kotlin Multiplatform Official Guide — Overview of KMP and sharing code across platforms.
  • Touchlab Sky Plugin — Compiler plugin that bridges Kotlin flows to Swift async sequences, used in the talk.

130 words

Radar Profile

The radar profile shows very high scores in quantity, quality, and technical depth, with a slight dip in reliability due to some observed rather than officially documented figures. Overall, this is a highly informative and technically robust talk.

Reliability 8/10