Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Android
  3. Kotlin MVVM example

Kotlin MVVM example

Kotlin

A sample Android app demonstrating MVVM architecture in Kotlin using ViewModel, LiveData, Retrofit, and testing libraries.

GitHubGitHub
549 stars116 forks0 contributors

What is Kotlin MVVM example?

kotlin-mvvm is a sample Android application that demonstrates how to implement the Model-View-ViewModel (MVVM) architectural pattern using Kotlin. It integrates Android Architecture Components like ViewModel and LiveData with libraries such as Retrofit for networking and Mockito for testing. The project serves as a hands-on reference for building well-structured, testable Android apps following modern best practices.

Target Audience

Android developers learning MVVM architecture, Kotlin programmers seeking practical examples, and teams adopting Android Architecture Components in their projects.

Value Proposition

It provides a clear, production-ready example with multiple branch implementations showcasing advanced topics like State Flow, Jetpack Compose, and dependency injection, helping developers avoid common pitfalls and accelerate their learning.

Overview

MVVM(Model View ViewModel) sample in Kotlin using the components ViewModel, LiveData and Retrofit library

Use Cases

Best For

  • Learning MVVM architecture in Android with Kotlin
  • Implementing ViewModel and LiveData in a real app
  • Integrating Retrofit for API calls in an Android project
  • Writing unit tests with Mockito for Android components
  • Exploring advanced Android topics like State Flow or Jetpack Compose via example branches
  • Building a reference architecture for new Android applications

Not Ideal For

  • Projects using Java instead of Kotlin for Android development
  • Teams needing an out-of-the-box production app with minimal setup
  • Applications requiring the latest library versions and cutting-edge Android features

Pros & Cons

Pros

Clear MVVM Implementation

Provides a straightforward example with ViewModel and LiveData, including architecture diagrams and flow charts that visualize the pattern, as shown in the README's images.

Popular Library Integration

Demonstrates integration with standard Android libraries like Retrofit for networking, Glide for images, and Mockito for testing, making it practical for real-world use.

Advanced Topic Branches

Offers multiple branches covering State Flow, Jetpack Compose, RxJava, Hilt, and more, allowing developers to explore extended implementations beyond the basics.

Testing Emphasis

Includes unit tests with Mockito and references to testing strategies, highlighting how to test ViewModel and LiveData components effectively.

Cons

Outdated Dependencies

Uses older versions like Retrofit 2.3.0 and OkHttp 3.4.1, which may lack recent features, performance improvements, and security updates.

Setup Complexity

The numerous branches for different implementations (e.g., State Flow, Compose, Hilt) can be overwhelming for beginners, requiring careful selection and configuration.

Limited Flexibility

Tied to a specific tech stack; adapting to alternative libraries (e.g., Koin instead of Hilt or Picasso instead of Glide) requires significant code changes.

Frequently Asked Questions

Quick Stats

Stars549
Forks116
Contributors0
Open Issues2
Last commit3 years ago
CreatedSince 2019

Tags

#unit-testing#android#sample-project#viewmodel#mvvm-architecture#retrofit#mobile-development#kotlin

Built With

R
Retrofit
K
Kotlin
G
Glide
A
AndroidX
M
Mockito
G
Gradle
O
OkHttp

Included in

Android12.0k
Auto-fetched 1 day ago

Related Projects

Android Architecture BlueprintsAndroid Architecture Blueprints

A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.

Stars45,796
Forks11,865
Last commit9 days ago
Android Modular ArchitectureAndroid Modular Architecture

📚 Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Stars2,435
Forks390
Last commit5 years ago
Complete-Google-Map-API-TutorialComplete-Google-Map-API-Tutorial

Learn How to use Google Map API for Android from Basic to Advance with complete examples.

Stars129
Forks17
Last commit5 years ago
Kotlin VIPER exampleKotlin VIPER example

Android Viper template with Kotlin, Dagger 2, Retrofit & RxJava

Stars41
Forks20
Last commit6 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub