Deep-Dive

CLEAN architecture with MVP

Clean architecture is all the rage these days in the android world. And for good reason. Historically activities and fragments have lead to god-classes that know and do everything. (especially if you try to follow google’s tutorials and examples).

As the Android development community has moved away from MVC with activities functioning as mega view/controller gods, MVP has become a big player.

I’m going to assume that you understand the basics of MVP and CLEAN and the motivations behind them and focus on the real-world implementation in the TED app.

We’re going to use the TalkDetails screen as an example and check out the presenter, view, interactor, and model layers that power it.

The details screen for specific talks.

Fair warning, this turned out a bit long. We’ll check out the presenter classes and the view interface definition in them. The view implementation and the XML UI. The interactors and the models behind them.

I tried to make it as concise as possible without skipping over important info, but this small vertical slice of code to show this one screen is actually pretty deep.