This course is available as part of the raywenderlich.com Professional subscription. To learn more click here
Pro

MVVM on Android

Sep 1 2022 · Video Course (49 mins) · Intermediate

In this course, you will learn how to build an Android app using the Model-View-ViewModel presentation architecture pattern including testing.

Version

  • Kotlin 1.6, Android 12, Android Studio Chipmunk | 2021.2.1 Patch 1

MVVM on Android

Introduction

2:28 Free

Let’s review what you will be learning in this course, including a brief discussion of benefits of MVVM and the course sample project.

1

Learn about the need for architecture patterns like MVVM and define the layers of an MVVM app.

2

Create the Model layer for the course sample project, including adding JUnit tests of Model layer classes.

3

Create a repository interface for saving your Model data, and implement a concrete version of the repository using the Room database library.

4

Examine the XML layout file and Kotlin class that constitute the View layer of the Add Creature screen.

5

See how to use the Android Architecture Component ViewModel and LiveData classes to create a ViewModel layer for your app.

6

Use JUnit to add unit tests for the functionality of the ViewModel layer, while utilizing Mockito to mock dependent classes.

7

Add the ability for the ViewModel to save Model data into the repository when receiving user events from the View layer.

8

Prove out your understanding of writing ViewModel tests by adding a test

9

Put your new MVVM skills to work by creating a ViewModel for the All Creatures screen that shows a list of all creatures in the repository.

10

Conclusion

1:45

Review what you learned in the course and learn about other potential architecture patterns for your Android apps.

11

Version history

Android 12, Kotlin 1.6, Android Studio Chipmunk | 2021.2.1 Patch 1 (Selected)

Sep 1 2022

Android 4.4+, Kotlin 1.2, Studio 3.1.4

Oct 16 2018

Who is this for?

Intermediate Android developers who want to learn how to structure their projects in a scalable and maintainble way using the Model-View-ViewModel architecture pattern.

Covered concepts

  • Separation of Concerns
  • Model-View-ViewModel (MVVM)
  • Repository Pattern
  • Writing Automated Tests

Contributors

Comments