This repository contains a detailed sample app that implements MVVM architecture using Room, LiveData, Retrofit,DataBinding, ViewModel,RxJava.
- MVVM Architectural pattern
- Offline Support
- Jetpack Components - Room, LiveData, DataBinding, Paging
- Unit test demonstration using JUnit and Mockito
- UI unit test demonstartion using Espresso
- Networking - Retrofit with Coroutines
- Dependency Injection - Hilt
The application has been built with offline support. It has been designed using Android Architecture components with Room for offline data caching. The application is built in such a way that whenvever there is a service call, the result will be stored in local database.
The whole application is built based on the MVVM architectural pattern.
The main advatage of using MVVM, there is no two way dependency between ViewModel and Model unlike MVP. Here the view can observe the datachanges in the viewmodel as we are using LiveData which is lifecycle aware. The viewmodel to view communication is achieved through observer pattern (basically observing the state changes of the data in the viewmodel).
- models: It contains all the data accessing and manipulating components.
- api: It contains network calls and its interface.
- database: It contains entity and dao class for storing the data in local
- helper: It contains constant variables and common methods.
- ui: View classes along with their corresponding ViewModel.
a) Android Architectural Components
b) Hilt for Dependency Injection
c) MVVM
d) Retrofit with Okhttp
e) Room for data caching
f) JUnit and Mockito for Unit testing
d) Repository pattern