---
title: "Building Shopify POS for Android Using MVVM"
description: "Shopify’s Android Point of Sale app adopted Model-View-ViewModel (MVVM) to replace an inconsistent codebase containing both MVC and MVP. Because the roughly three-and-a-half-year-old app could not be migrated at once, the team used MVVM for all new screens and converted legacy screens during significant changes. In the architecture, Fragments and sub-views report UI actions through contracts, ViewModels fetch and mutate data, and LiveData delivers updates to active observers. ViewModelProvider retains ViewModel instances across Activity or Fragment configuration changes, while Models handle databases, networks, and caches. Shopify reports more consistent development, easier onboarding and testing, lifecycle-safe UI updates, and a codebase that is easier to modify, although some MVC and MVP screens remain."
---

# Building Shopify POS for Android Using MVVM

[Shopify](https://yomu.fyi/company/shopify) · Richa Khanna · Oct 31, 2018

**Type:** Tutorial

## Summary

Shopify’s Android Point of Sale app adopted Model-View-ViewModel (MVVM) to replace an inconsistent codebase containing both MVC and MVP. Because the roughly three-and-a-half-year-old app could not be migrated at once, the team used MVVM for all new screens and converted legacy screens during significant changes. In the architecture, Fragments and sub-views report UI actions through contracts, ViewModels fetch and mutate data, and LiveData delivers updates to active observers. ViewModelProvider retains ViewModel instances across Activity or Fragment configuration changes, while Models handle databases, networks, and caches. Shopify reports more consistent development, easier onboarding and testing, lifecycle-safe UI updates, and a codebase that is easier to modify, although some MVC and MVP screens remain.

## Context

The POS app had accumulated both MVC and MVP, making architecture choices inconsistent and creating difficulty for developers switching between approaches. The team adopted MVVM as a common standard while continuing to support and gradually replace legacy screens.

## Approach / What changed

New screens use MVVM, while older screens are converted when significant changes are made. Fragments and sub-views communicate UI actions to ViewModels through interfaces or contracts; ViewModels retrieve and mutate data, publish changes through LiveData, and rely on Models for databases, networks, and caches.

## Takeaways

- Shopify standardized on MVVM because having both MVC and MVP in the POS codebase made architecture choices inconsistent for developers.
- View and ViewModel communicate through contracts rather than direct references, while LiveData carries updated data back to active UI observers.
- ViewModel state survives Activity or Fragment configuration changes, enabling independent ViewModel unit tests and View screenshot tests.

## FAQ

### How does MVVM preserve POS data when the screen rotates?

ViewModelProvider retains the ViewModel while the associated Activity or Fragment scope remains alive. A recreated Activity or Fragment reconnects to the existing ViewModel, so its held data remains available.

### Why does the architecture use LiveData for UI updates?

The View subscribes to LiveData and receives data changes from the ViewModel. LiveData only sends updates to active observers, helping avoid crashes and other lifecycle issues when the app is inactive.

### How did Shopify migrate screens from MVC and MVP to MVVM?

The team did not switch the entire app at once. It used MVVM for every new screen and converted older screens when making significant changes, leaving a few legacy MVC and MVP screens.

**Tags:** [Android](https://yomu.fyi/topic/android), [Architecture](https://yomu.fyi/topic/architecture), [LiveData](https://yomu.fyi/topic/livedata), [MVVM](https://yomu.fyi/topic/mvvm)

- Source: [Shopify](https://shopify.engineering/building-shopify-pos-android-using-mvvm)
- Source URL: https://shopify.engineering/building-shopify-pos-android-using-mvvm
- Ingested by Yomu: 2026-09-17T14:06:30.143Z

[Read original post](https://shopify.engineering/building-shopify-pos-android-using-mvvm)
