kunminx/jetpack-mvvm-best-practice — explained in plain English
Analysis updated 2026-06-24
Learn how to wire Jetpack ViewModel and LiveData together in an Android app without memory leaks or errors.
Use as a reference architecture for building an Android app with layered UI, ViewModel, and DataRepository structure.
Implement safe screen rotation handling and inter-screen messaging in an Android Jetpack project.
| kunminx/jetpack-mvvm-best-practice | pojavlauncherteam/pojavlauncher | checkstyle/checkstyle | |
|---|---|---|---|
| Stars | 8,939 | 8,939 | 8,934 |
| Language | Java | Java | Java |
| Setup difficulty | moderate | hard | easy |
| Complexity | 3/5 | 4/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Android Studio and a connected Android device or emulator to run the sample.
This is an Android sample application that demonstrates how to use Google's Jetpack MVVM architecture correctly and without common mistakes. The README is written in Chinese, and the project is aimed at Android developers who want a clear, working example of how Jetpack components fit together, rather than yet another article that pastes disconnected code snippets. Jetpack is a collection of Android libraries from Google covering things like ViewModel (which stores screen state across configuration changes), LiveData (which notifies the UI when data changes), Navigation (which manages screen transitions), and DataBinding (which connects layout files directly to data). The project shows how to wire these pieces together in a way that avoids memory leaks and unpredictable errors, particularly when switching between portrait and landscape layouts or when sending messages between different screens. The sample app takes the form of a music player, similar in appearance to Tencent's lighter music app. It demonstrates portrait-to-landscape layout switching with no unexpected errors, a unified event distribution system using LiveData and shared ViewModels, and a layered architecture where the UI layer talks to the ViewModel layer, which in turn talks to a DataRepository, with no reverse dependencies. The project avoids dependency injection tools like Dagger and explicitly states the goal is readable, maintainable code rather than clever tricks. The code is written entirely in Java and is licensed under the Apache License 2.0. According to a survey in the README, the architecture patterns shown here have been referenced or adopted by software teams at Tencent Music, NetEase Cloud Music, TCL, BMW, and several other companies. The app is available to download and try directly from app stores.
A sample Android music player app that shows Java developers how to correctly use Google Jetpack components like ViewModel, LiveData, and Navigation without common mistakes.
Mainly Java. The stack also includes Java, Android, Jetpack.
Free to use, modify, and distribute for any purpose including commercial use, with attribution.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.