Skip to content

Sample app that implements MVVM architecture using Kotlin, Room, LiveData, Retrofit, DataBinding, ViewModel, Coroutines.

Notifications You must be signed in to change notification settings

HemaSathiz/BYJU-s-Assignment

Repository files navigation

Sample Headliness App

This repository contains a detailed sample app that implements MVVM architecture using Room, LiveData, Retrofit,DataBinding, ViewModel,RxJava.

Highlights

  1. MVVM Architectural pattern
  2. Offline Support
  3. Jetpack Components - Room, LiveData, DataBinding, Paging
  4. Unit test demonstration using JUnit and Mockito
  5. UI unit test demonstartion using Espresso
  6. Networking - Retrofit with Coroutines
  7. 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.

Application Architecture

alt text

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).

image image

The app has following packages:

  1. models: It contains all the data accessing and manipulating components.
  2. api: It contains network calls and its interface.
  3. database: It contains entity and dao class for storing the data in local
  4. helper: It contains constant variables and common methods.
  5. ui: View classes along with their corresponding ViewModel.

Programming Practices Followed

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

Classes have been designed in such a way that it could be inherited and maximize the code reuse.

Library reference resources:

  1. Room: https://developer.android.com/topic/libraries/architecture/room.html

About

Sample app that implements MVVM architecture using Kotlin, Room, LiveData, Retrofit, DataBinding, ViewModel, Coroutines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages