How to Implement Clean Architecture in Android

Photo by Bram Naus on Unsplash

How to Implement Clean Architecture in Android

Mid-level engineer guide to senior developer

Need for Architecture

In this series, I will take you through implementing Clean Architecture in Android. Most mid-level Android developers are comfortable building applications with MVVM or MVC patterns. The patterns are enough for applications of medium complexity. However, as the team and application grow, you need a robust architecture for your application. That is where Clean Architecture comes in.

Opinion: Using Clean Architecture in simple applications would be overengineering

Architecture Overview

There are several tutorials on what Clean Architecture is, and why it is needed. I have sampled a few, sources. The architecture proponent, Robert Cecile Martin has a blog where he explains Clean architecture. Clean Architecture Book is one of the best sources if you prefer books. FreeCode Camp has a good resource. There are other sources you can learn why you need Clean Architecture for robust applications.

The code implementation

Most senior engineers use Clean Architecture in their applications. Although the codebase is clean and thus easy to understand, someone scaling from mid-level to senior will have issues understanding the coding styles in those apps. I will focus on the reason why we have to do what we are doing to make it easier for you to understand.

I will implement a GitHub Profiles application using clean architecture. I will explain what is happening in each class, and why it is needed for a robust, clean app.

End of overview

I will maintain single responsibility even on the documentation.

Next, we will do the project structure, and get necessary library dependencies