MVI on Android

In this course, you will use RxJava to build an app using the Model-View-Intent architecture, learning about components like intents, results, and state. By Joe Howard.

Leave a rating/review
Save for later
Comments
Share

Learning path

This is part of the Android Architecture learning path. View path.

Who is this for?

This course is for intermediate Android developers who have previously been exposed to architecture considerations on Android. They have potentially used patterns like MVP and MVVM but are looking to use MVI for the first time or have used MVI but are looking for a deeper understanding of the pattern.

Covered concepts

Students will learn:

  • The concepts and structure of the MVI pattern
  • MVI actions and intents
  • How to build an app using MVI
  • How to test an MVI app
  • Where MVI fits in within a more complicated app architecture
  • How to define and process results
  • How to define a view state and render it to the screen

Part 1: From Intention to Action

01
Toggle description

Let's introduce the Model-View-Intent architecture, identify the sample project we'll be working with, and see an outline of the course.

Toggle description

Learn about the origins and theory of MVI, and get introduced to the MVI event cycle, which we'll use throughout the course.

Toggle description

Take a tour through the starter project code, and learn how it differs from the code in our other architecture courses.

Toggle description

See a summary of prereqs for the course, which include intermediate knowledge of Android, experience with sealed classes, and a basic understanding of RxJava.

Toggle description

Create the base interfaces that will be used for the MVI component types, and define behavior for the View and ViewModel classes within MVI.

Toggle description

Identify the MVI intents for each screen of the app, and create Kotlin sealed classes to represent the intents

Toggle description

Practice defining an intent for the Add Creature screen on your own, through a hands-on challenge. Then see a solution.

Toggle description

Identify the MVI actions for each screen of the app, and create Kotlin sealed classes to represent the actions.

Toggle description

Practice defining an action for the Add Creature screen on your own, through a hands-on challenge. Then see a solution.

Conclusion 0:43
Toggle description

Let's review where you are within the overall MVI cycle, and discuss what's next: building out the remainder of the cycle.

Part 2: Results, State, and the View

Toggle description

Let's review what you'll be doing in this part of the course, building out the second half of the MVI cycle and finishing the app.

Toggle description

Define results for the All Creatures screen, then use an Rx ObservableTransformer to process actions into results.

Toggle description

Define results for the Add Creature screen, then use an Rx ObservableTransformer to process actions into results.

Toggle description

Practice defining results and a processor for the Add Creature screen on your own, through a hands-on challenge. Then see a solution.

Toggle description

Learn how to think about the state of your screen's view, and define a view state for both screens of the app.

Toggle description

See how reducers are used to combine previous view state with results to create a new view state, and define view state classes for each screen.

Toggle description

Practice defining a reducer for the Add Creature screen on your own, through a hands-on challenge. Then see a solution.

ViewModels 5:29
Toggle description

Complete the remainder of code needed for the app ViewModels, by turning intents into actions, processing to results, and reducing results to new view state.

Toggle description

Add a ViewModel property for the All Creatures screen, bind to the ViewModel, and render view state to the screen.

Toggle description

Add a ViewModel property for the Add Creature screen, bind to the ViewModel, and render view state to the screen.

Toggle description

Learn about how to set up tests for an MVI ViewModel class, using JUnit and Mockito. Then define tests for the loading intent on the All Creatures screen.

Conclusion 3:16
Toggle description

Let's review what you learned in this course, discuss the benefits of the MVI architecture, and see where to go from here.

Up next

Android & Kotlin
MVP on Android
In this course, you will learn how to build an Android app using the Model-View-Presenter presentation arc... more

Instructors

Contributors

Over 300 content creators. Join our team.