Clean architecture is what developers strive for in any platform development. In recent years, there are many attempts to make clean architecture in Android a thing for reusable code and easy test-ability. That’s a good sign for the Android development community and there have been many good tutorials and templates to learn from.
This article is a step-by-step introduction to MVP on Android. It shows both simple examples and advanced ones with best practices.
Google should have created this template and made it a built-in plugin for Android Studio. This is an MVP template created by ProAndroidDev. You can forget about the boilerplate code written at the beginning of a new project. It is not a one-size-fits-all solution so you need to modify the template based on your project’s features and design.
This project, created by Google employees showcases a basic Model‑View‑Presenter architecture. The result will be a to-do app with basic features, including a task list, task detail, task adding/editing, and statistics. This todo-mvp project uses the following dependencies: Common Android support libraries, Android Testing Support Library, Mockito, and Guava.
This is a boilerplate template ribot used as a reference for new Android projects. You can see how they integrate popular libraries: Support libraries, RecyclerViews and CardViews, RxJava and RxAndroid, Retrofit 2, Dagger 2, SqlBrite, Butterknife, Timber, Glide, AutoValue with extensions AutoValueParcel and AutoValueGson, Functional tests with Espresso, Robolectric, Mockito, and Checkstyle, PMD and Findbugs for code analysis.
Exchange Rates (MVVM)
This is a currency-exchanging app that incorporates MVVM, data binding, RxJava2, Dagger2, and a clean architecture approach.
Android starter (MVP)
Android starter is an MVP project with the support of Dagger2, RxJava2, Robolectric, Espresso, and Mockito. It provides a generator to quickly create an Android template project.
This tutorial guides you through MovieNight, an app that uses the clean architecture approach and is written in Kotlin. MovieNight uses The MovieDB public API, which is free to register.
This template demonstrates the MVP approach written in Kotlin in addition to components from Android Architecture Components Library such as ViewModels, and Room. It features Kotlin, Android Architecture Components, Android Support Libraries, RxJava2, Dagger 2 (2.11), Glide, Retrofit, OkHttp, Gson, Timber, Mockito, Espresso, and Robolectric.