Structure MVP Android

Asked

Viewed 1,330 times

0

I’m studying MVP and I was left with doubt of how I should structure my packages on android. On the Internet I found this model, but I don’t know if it’s the best project on github.

1 answer

4


There is much discussion about what would be the ideal way to implement the standard Model View Presenter in the Android. Since there is no "correct" formula, it will be up to you which path to choose. Separating interface from logic on Android is an arduous task, but the MVP standard makes it a little easier to prevent our activities from degrading into very coupled classes consisting of hundreds or thousands of lines. It is essential to organize the code well in large applications, otherwise it becomes impossible to maintain and extend it.

See below some articles that will help you understand, so you can analyze better according to your need:

And these repositories with some details:

See below how it is basically organized:

inserir a descrição da imagem aqui

According to the android-mvp-Architecture on Github, see a basic application like your architecture:

inserir a descrição da imagem aqui

As to the project on Github, You can see that a lot of people favored it and probably, I mean probably, joined it. Usually the person to get to the point of using this method, must also have performed several other research and reached a conclusion.

As suggested by @olive tree, Google itself provides a Codelab with a brief introduction on MVP Architecture: Model-View-Presenter (MVP) Architecture.

  • 2

    In this codelabs Google also has a good introduction to MVP: https://codelabs.developers.google.com/codelabs/android-testing/index.html?index=..%2F.. %2Findex#3

  • @Márciooliveira edited and inserted in the reply. Vlw.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.