0

I just start with architecture components, so I would like to know differences with clean architecture and What is the best way to implement with MVP.

How to integrate ViewModel with presenter. I appreciate any help with this

Jesse
  • 3,243
  • 1
  • 22
  • 29
user1153174
  • 133
  • 1
  • 10
  • The first thing you can do to adapt MVP to use architecture components is to make your presenter LifeCycle aware with the LifeCycleOwner and LifeCycleObserver classes. But from what I've gathered architecture components go better with the MVVM pattern than the MVP. ViewModel is clearly and indication of that, and even if Google doesn't say they favored this pattern we can see they did. There is a modified version of MVP with View Models that people call MVP-VM, you can see an example here https://github.com/chiara-jm/android-mvp-vm – Levi Moreira Feb 08 '18 at 11:03

1 Answers1

1

Architecture Components are independent libraries made to help make better Android apps. You can fit them in any Architecture based upon on your need.

That said, Google recommends using MVVM architecture in their Architecture Guidelines. Also you can use Presenterwith MVVP architecture.

Take a look at this News Sample app made by following Architecture Guidelines or check out the Clean Architecture with Architecture Components Template by Buffer

Akshay Chordiya
  • 4,761
  • 3
  • 40
  • 52