Full form of MVP is Model View Presenter. ➤ M - Model (Models representing data) ➤ V - View (Activities, Fragments, Custom Views) ➤ P - Presenter (Mediator) ➤ It’s an structure for writing Android Applications. ➤ It provides separation of concerns, reusability, testability, abstraction of data layer.
M - Model (same as MVP) ➤ V - View (same as MVP) ➤ VM - ViewModel (all the UI logic goes here) Source : https://labs.ribot.co.uk/approaching-android-with-mvvm-8ceec02d5442
reference to the View. So the tight coupling between View and Presenter is gone. ➤ In MVVM ViewModel provides the data without knowing who is going to consume it. So in MVVM View -> ViewModel relation can be 1:many while MVP has 1:1 relationship. ➤ Less boilerplate code. ➤ ViewModel handles device state automatically :). ➤ Views are easily testable using Expresso, and ViewModel and Models are easily testable using JUnit.