Sign in Go Pro

Android Model-View-ViewModel Pattern

Adding a Repository

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson
Autoplay

Up next

Previous

About

In this lesson you'll learn about an important design pattern, the Repository Pattern, to abstract the source of data in your MVVM application. We'll be adding a Repository to the Tip Calculator app to store and retrieve tips calculated by our users at various restaurants. We'll also look at how to test your Repository and how to test LiveData results.

Key concepts in this lesson that you will learn:

  • What the Repository pattern is and how to implement it within your app.
  • A TDD approach to defining your Repository API.
  • What LiveData is and it works in the scope of an Activity
  • How to test LiveData in a JVM / JUnit Test with the InstantTaskExecutorRule
  • What a Junit Test Rule is and how it works

Instructor

Links

Comments

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