Skip to content

This project is to showcase potential of UI building approaches in Android

License

Notifications You must be signed in to change notification settings

Unique0o/FastPay

Repository files navigation

Android Clean Architecture

A demo movie android app that demonstrates Clean Architecture and is written in Kotlin.💯🎞

Features

  1. Offline-first: The app can be accessed even without an internet connection.
  2. Pagination: Efficiently loads large amounts of data to improve the user experience.
  3. Search functionality: Allows users to quickly find specific information within the app.
  4. Auto Sync: Uses both NetworkConnectivityStream and WorkManager to ensure data is always up-to-date.
  5. Favorites: Users can add movies to a favorites list.

The Motivation behind the app

This repository is created as a base repository that represent the base architecture for every project that will be created onwards. Everyone needs to follow this architecture everytime a new project is assigned.

⚠️NOTE

Architecture by its nature is dynamic and ever-evolving, there are always several solutions to every problem, and what works best will depend on the specific requirements and constraints of your project.

Screenshots

Mode Feed Favorites Movie Details Search
Dark
Light
Orientation Feed
Landscape

Clean Architecture

The core principles of the clean approach can be summarized as followed:

1. The application code is separated into layers.

These layers define the separation of concerns inside the code base.

2. The layers follow a strict dependency rule.

Each layer can only interact with the layers below it.

3. As we move toward the bottom layer — the code becomes generic.

The bottom layers dictate policies and rules, and the upper layers dictate implementation details such as the database, networking manager, and UI.

Architecture Layers

The application consists of three layers:

The domain layer, the data layer, and the presentation layer.

Looking at project’s high-level structure, you’ll see that each layer is represented by a module in the project.

image

I like it because it helps me avoid accidentals “leaks” between the layers.

Structure

Built With 🛠

  • Kotlin - First class and official programming language for Android development.

  • Coroutines - For asynchronous and more..

  • Flow - A cold asynchronous data stream that sequentially emits values and completes normally or with an exception.

  • StateFlow - A live data replacement.

  • Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.

    • Paging3 - Load and display small chunks of data at a time.
    • LiveData - Data objects that notify views when the underlying database changes.
    • ViewModel - Stores UI-related data that isn't destroyed on UI changes.
    • SavedStateHandle - A handle to saved state passed down to androidx.lifecycle.ViewModel.
    • ViewBinding - Generates a binding class for each XML layout file present in that module and allows you to more easily write code that interacts with views.
    • Navigation Components - Navigate fragments easier.
    • Room - Persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
    • WorkManager - Schedule deferrable, asynchronous tasks
  • Dependency Injection

    • Hilt - Easier way to incorporate Dagger DI into Android application.
  • Retrofit - A type-safe HTTP client for Android and Java.

  • Mockito - For Mocking and Unit Testing

Code Style

The code style in this project was ensured using Detekt.

Check command:

./gradlew detekt

Feel free to submit any type of issues and suggestions for improving the coding standard

Happy Coding!!!

About

This project is to showcase potential of UI building approaches in Android

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages