A clean architecture starting point for android projects
Check my article on Medium: https://nicola-gallazzi-dev.medium.com/clean-architecture-in-android-a-beginner-approach-be0ce00d806b
-
Presentation: the layer that interacts with the UI.
-
Use cases: The actions that the user can trigger (clicking on a button, navigating to a destination)
-
Domain: contains all the business models (data classe s)
-
Data: contains an abstract definition of different data sources. It's modeled using repositories and data sources
-
Framework: implements the dependencies (proper of android framework) we provided in the rest of the layers. Should contain classes specific of the android framework
- App: includes everything about android framework, so Framework and Presentation layer
- Domain: contains the definitions of business logic of the app, the server data model, the abstract definition of repositories and the definition of the use cases. It’s a simple, pure kotlin module (android independent)
- Data: contains the implementation of the abstract definitions of the domain layer. Can be reused by any application without modifications. It contains repositories and data sources implementations, the database definition and its DAOs, the network APIs definitions, some mappers to convert network api models to database models and vice versa.