Architecture Patterns
This chapter will introduce you to architectural patterns you can use for your Android projects. It covers using the Model-View-ViewModel (MVVM) pattern, adding ViewModels, and using data binding. You will also learn about using the Repository pattern for caching data and WorkManager for scheduling data retrieval and storage.
By the end of the chapter, you will be able to structure your Android project using MVVM and data binding. You will also be able to use the Repository pattern with the Room library to cache data and WorkManager to fetch and save data at a scheduled interval.
In the previous chapter, you learned about using Coroutines and Flow for background operations and data manipulation. Now, you will learn about architectural patterns so you can improve your application.
When developing an Android application, you may tend to write most of the code (including business logic) in activities or fragments. This will make your project hard to test...