---
title: "Lessons From Building Android Widgets"
description: "Shopify revisited its Android widgets alongside an iOS widget effort, aiming to give merchants faster access to frequently changing business metrics. The team chose native Android development because React Native lacked official RemoteViews support, while widget configuration data was persisted with shared preferences and used to build requests. Because Android could invoke onUpdate() multiple times per cycle, they added a one-minute, short-lived cache keyed by widgetID and mindful of configuration such as locale. This reduced redundant network calls, system load, and incorrect analytics, while the widget rollout also exposed migration limitations between old fixed-size widgets and new space-responsive ones, leading Shopify to deprecate the old widgets rather than transform them."
---

# Lessons From Building Android Widgets

[Shopify](https://yomu.fyi/company/shopify) · 2023-10-18 · Sep 22, 2022

**Type:** Explainer

## Summary

Shopify revisited its Android widgets alongside an iOS widget effort, aiming to give merchants faster access to frequently changing business metrics. The team chose native Android development because React Native lacked official RemoteViews support, while widget configuration data was persisted with shared preferences and used to build requests. Because Android could invoke onUpdate() multiple times per cycle, they added a one-minute, short-lived cache keyed by widgetID and mindful of configuration such as locale. This reduced redundant network calls, system load, and incorrect analytics, while the widget rollout also exposed migration limitations between old fixed-size widgets and new space-responsive ones, leading Shopify to deprecate the old widgets rather than transform them.

## Context

Shopify’s widgets provide merchants with quick access to analytics and business metrics, but the metrics need to be fresh without causing excessive network usage. The team also needed to replace existing Android widgets while maintaining a consistent experience across Android and iOS and accounting for platform-specific constraints.

## Approach / What changed

The team built the widgets natively because React Native lacked official support for Android RemoteViews. Widget configuration was stored with shared preferences, dynamic metric definitions shaped requests and decoding, and a short-lived cache prevented repeated network calls during duplicate update callbacks. For the transition to the new widgets, Shopify deprecated the old fixed-size widgets and used in-widget messaging and help-center documentation to guide merchants.

## Takeaways

- Android widget updates can trigger onUpdate() multiple times in a cycle, causing duplicate network requests when every update fetches fresh data.
- A one-minute cache keyed by widgetID, with configuration such as locale included in the cache decision, reduced unused network calls, system load, and incorrect analytics.
- Shopify could not reliably transform fixed-size legacy widgets into new widgets that use available space, so it deprecated the old widgets alongside the new release.

**Tags:** [Android](https://yomu.fyi/topic/android), [Caching](https://yomu.fyi/topic/caching), [Migrations](https://yomu.fyi/topic/migration), [Performance](https://yomu.fyi/topic/performance)

- Source: [Shopify](https://shopify.engineering/lessons-building-android-widgets)
- Source URL: https://shopify.engineering/lessons-building-android-widgets
- Ingested by Yomu: 2026-08-30T13:38:50.520Z

[Read original post](https://shopify.engineering/lessons-building-android-widgets)
