Sign in Go Pro

Android Model-View-ViewModel Pattern

Add Save Functionality to the ViewModel

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next



In this lesson, we'll be updating the ViewModel to support saving a calculated tip by name. Through the process, you'll learn about computed properties with Kotlin and see first hand the value of good unit test coverage, to support code refactoring. We'll also learn about using Mockito to verify interactions with mock objects and how using a function within a function, can greatly simplify your test and convey intent.

Key concepts in this lesson that you will learn:

  • How to use Kotlin computed properties for the View
  • Refactoring with confidence, thanks to good test coverage
  • How to verify interactions with mock objects using Mockito
  • How to add a function within a function in Kotlin, to simplify them and convey intent.




There are no comments on this lesson, start the conversation below ...

You need to go PRO to post comments.

Lessons in Android Model-View-ViewModel Pattern