Skip to content

rakibhasan1030/Clean-Architecture-Android

Repository files navigation

Clean Architecture (Android)

platform

This is a sample todo list Android application 📱 built to demonstrate use of Clean Architecture tools. Dedicated to all Android Developers with ❤️.

You can Install and test latest app from below 👇

Clean Architecture App

- About

It simply loads list todos from {JSON} Placeholder and stores it in persistence storage (i.e. Room Database). Todos list will be always loaded from local database. Remote data (from API) and Local data is always synchronized.

  • Modular approch followed
  • It is heavily implemented by following standard clean architecture principle.
  • Offline capability.
  • S.O.L.I.D priciple followed for more understandable, flexible and maintainable.

- Built With 🛠

  • Kotlin - First class and official programming language for Android development.
  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
    • Room - SQLite object mapping library.
    • Hilt - Dependency Injection Framework
  • Retrofit - A type-safe HTTP client for Android and Java.
  • OkHttp - HTTP client that's efficient by default: HTTP/2 support allows all requests to the same host to share a socket
  • Ktlint - Ktlint is a static code analysis tool maintain by Pinterest. Linter and formatter for Kotlin code.

- Clean Architecture

What is clean architecture?

Architecture means the overall design of the project. It's the organization of the code into classes or files or components or modules. And it's how all these groups of code relate to each other. The architecture defines where the application performs its core functionality and how that functionality interacts with things like the database and the user interface.

Why the cleaner approach?

  1. Separation of code in different layers with assigned responsibilities making it easier for further modification.
  2. High level of abstraction
  3. Loose coupling between the code
  4. Testing of code is painless

Clean code always looks like it was written by someone who cares. - by Michael Feathers”

Layers

  • Domain - Would execute business logic which is independent of any layer and is just a pure kotlin/java package with no android specific dependency.
  • Data - Would dispense the required data for the application to the domain layer by implementing interface exposed by the domain.
  • Presentation / framework - Would include both domain and data layer and is android specific which executes the UI logic.

- Current App's Architecture

This app uses MVVM (Model View View-Model) architecture.




About

This is a sample todo list Android application built to demonstrate use of Clean Architecture tools.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages