MVP to MVVM Android

StuartDTO :

One guy from here told me that MVVM is better than MVP he told me many pros and many conts, but I'd like to know if my MVP is well done or if you know any other way maybe to convert to MVVM. It's a Sign in with Google MVP. I won't put all of the code but I'll put the folders and little explanation :

-Model

  • User (Simple user pojo class)

-Presenter

  • I have an object of my IGoogleLoginView where I call the methods, but here I have the logic createGoogleClient(),signIn(),onActivityResult(),onStop(), onStart(), onDestroy() all of those methods are from my interface inside the same package IGoogleSignIn
  • IGoogleSignIn - All of the methods from the Presenter class

-View

  • googleSignIn()
  • goToMainActivity()

And then I have my MainActivity where I call the methods...

I'm wondering how different could be to do that on MVVM and what would be the changes to do it, and also is something that it's not on the good place?

Kyriakos Georgiopoulos :

Here is a knowledge base to get started, you should make your own project and implement these software architectures in order to adopt the one that works for you and your project:

Android Architecture Blueprints

Android Architecture Blueprints

Reactive Apps with MODEL-VIEW-INTENT - PART1 - Model

enter image description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=90595&siteId=1