android-mvvm

Structure Android apps with MVVM using ViewModel, LiveData, and StateFlow.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HuxleyMc/Android-Skills --skill android-mvvm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-mvvm
Source: https://github.com/HuxleyMc/Android-Skills/tree/main/android-mvvm
Command: npx skills add https://github.com/HuxleyMc/Android-Skills --skill android-mvvm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Android apps often suffer from tightly coupled UI and business logic, making testing and maintenance hard. This Skill guides implementing MVVM to cleanly separate concerns and enable responsive UIs.

Core Features & Use Cases

  • ViewModel-driven UI: UI components observe LiveData or StateFlow to automatically react to data changes.
  • Data binding & state management: Bind UI to data sources to reduce boilerplate and improve testability.
  • Use Case: Imagine a profile screen that loads user data; the UI updates automatically as data arrives and gracefully handles errors.

Quick Start

Install the necessary Android architecture components, enable view binding, and bootstrap a simple MVVM flow with a ViewModel exposing LiveData or StateFlow and a Fragment observing it.

Frequently Asked Questions about android-mvvm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I separate Android UI and business logic using MVVM?

You can separate Android UI and business logic using MVVM by structuring your app with a ViewModel to hold data and expose it via LiveData or StateFlow. UI components in Fragments observe these state changes to update automatically.

What is the best way to manage state in an Android MVVM app?

The best way to manage state in an Android MVVM app is using StateFlow or LiveData within your ViewModel. These data binding components hold and emit state changes, allowing the UI to react automatically as repository data arrives.

Do I need LiveData or StateFlow to implement MVVM in Android?

You need either LiveData or StateFlow to implement MVVM in Android, as they expose observable state from the ViewModel. Both standard Android architecture components allow UI components to react automatically to data changes.

How to set up data binding with a ViewModel in Android?

To set up data binding with a ViewModel in Android, install the necessary Android architecture components and enable view binding. Your ViewModel then exposes LiveData or StateFlow, which the Fragment observes to react automatically to repository data.

When should I use MVVM architecture in my Android app?

You should use MVVM architecture in your Android app when you need testable, maintainable structures with clean separation of UI and business logic. It is ideal for screens displaying repository data that must handle errors gracefully.