Need help with simple-mvp?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

201 Stars 51 Forks 35 Commits 2 Opened issues


Framework canônico para aplicação do padrão Model View Presenter no Android

Services available


Need anything else?

Contributors list

# 229,273
10 commits


A Model View Presenter Library using plain and simple interfaces, based on concept from Dr. Douglas Schmidt

Attention: simple-mvp is still an experimental library created for education purposes.
Some methods and operations may change until its maturity.

Created by Tin Megali

Learn more

Quick install

  1. add build.gradle
    compile 'com.tinmegali.mvp:mvp:0.0.7'
  2. Create interfaces to communicate between MVP layers
    • interface RequiredViewOps extends ActivityView
      with VIEW methods to be accessed by PRESENTER
    • interface ProvidedPresenterOps extends PresenterOps
      Operations offered to VIEW to communicate with PRESENTER
    • interface RequiredPresenterOps
      with Required PRESENTER methods available to MODEL
    • interface ProvidedModelOps extends ModelOps
      Operations offered to MODEL to communicate with PRESENTER
  3. Implement MVP objects extending its generics
    • MODEL from Model View Presenter (MVP) pattern. class MODEL extends GenericModel implements MVP_MainActivity.ProvidedModelOps
    •         <li>VIEW layer of MVP pattern <br>
                      class VIEW_Activity extends GenericMVPActivity<mvp_mainactivity.requiredviewops mvp_mainactivity.providedpresenterops mainpresenter> 
                      implements MVP_MainActivity.RequiredViewOps
                  </mvp_mainactivity.requiredviewops></code> <br>
                  <em>Could also extend <code>GenericMVPFragment</code></em>
              <li>PRESENTER from Model View Presenter (MVP) Pattern. <br>
                      class MainPresenter extends GenericPresenter<mvp_mainactivity.requiredpresenterops mvp_mainactivity.providedmodelops mvp_mainactivity.requiredviewops mainmodel>

Instalação rápida

  • Crie as interfaces de comunicação entre os módulos View, Presenter e Model
    1. interface RequiredViewOps fornece métodos para Presenter comunicar com View. É necessário extender ActivityView
    2. interface ProvidedPresenterOps fornece operações oferecidas ao layer View para comunicação com Presenter. É preciso extender PresenterOps
    3. interface RequiredPresenterOps operações oferecidas pelo layer Presenter para comunicações com Model
    4. interface ProvidedModelOps operações oferecidos pelo layer Model para comunicações com Presenter. É preciso extender ModelOps
  • Crie a classe Model extendendo GenericModel e implementando ProvidedModelOps ex: {@link com.tinmegali.androidmvp.main.model.MainModel}
  • Crie a classe Presenter extendendo GenericPresenter, implementando RequiredPresenterOps e ProvidedPresenterOps. exemplo: {@link com.tinmegali.androidmvp.main.presenter.MainPresenter}
  • Crie a classe View GenericMVPActivity ou GenericMVPFragment e implementando RequiredViewOps Exemplo: {@link com.tinmegali.androidmvp.main.view.MainActivity}
  • .

Android MVP Class Diagram

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.