The architecture of our Android apps is based on the MVP (Model View Presenter) pattern.
-
View (UI layer): this is where Activities, Fragments and other standard Android components live. It's responsible for displaying the data received from the presenters to the user. It also handles user interactions and inputs (click listeners, etc) and triggers the right action in the Presenter if needed.
-
Presenter: presenters subscribe to RxJava Observables provided by the
DataManager
. They are in charge of handling the subscription lifecycle, analysing/modifying the data returned by theDataManager
and calling the appropriate methods in the View in order to display the data. -
Model (Data Layer): this is responsible for retrieving, saving, caching and massaging data. It can communicate with local databases and other data stores as well as with restful APIs or third party SDKs. It is divided in two parts