Code Monkey home page Code Monkey logo

albumexplorer's Introduction

Album Explorer

Album Explorer project shows modern Android development, following Android design and development best practices. It's inspired by NowInAndroid project and Guide to app architecture.

To Do improvements

  • Add Paging library for view and local datasource, by the way remote datasource is a JSon mock not paginated ๐Ÿ˜Ÿ
  • Add instrumented test on UI
  • Put com.lyh.albumexplorer.feature.album.util classes in a new module feature-code-test
  • Create a custom Gradle Plugin for java-library module, and use it instead of com.android.library in modules don't have Android dependencies as data-remote, data, ...
  • Create a custom Gradle Plugin for compose module
  • Manage [large screen] (https://developer.android.com/guide/topics/large-screens/get-started-with-large-screens)
  • Use SavedStateHandle for passing parameters to screen whe [bug] (InsertKoinIO/koin#1350) fixed

Architecture

Application uses:

  • Clean Architecture for separate business logic [domain], services (storage, API, ...) [data] and [presentation] layers

Clean Architecture

  • MVVM (Model-View-ViewModel) design pattern for presentation layer

Clean Archi and MVVM help:

  • to avoid or reduce dependencies between layers (separation of concerns)
  • to test easily
  • to have uniform way to develop
  • ...

Clean Architecture stack uses Flow to stream data, from data layer to presentation layer.

UI use Jetpack Compose.

Modularization

  • app [clean-archi/presentation]: Single-Activity and Application classes
    • feature-album: feature showing album data, using MVVM pattern
    • feature-core: common classes and resources (styles, strings, drawable) for feature modules
  • build-logic : for gradle plugins, to share common configuration
  • data [clean-archi/data]: repositories
    • data-local: to store and access data locally
    • data-remote: for API calls
  • domain [clean-archi/domain]: for business logic, use-case

Tests

  • data: unit tests on repository and helper
    • data-local : Instrumented tests for use in-memory Room database
    • data-remote: unit tests on helper
  • domain: unit tests on use-case
  • app
    • feature-album : unit tests on view-model

Build system

  • Project uses Gradle build system with Kotlin DSL (kts).
  • Catalog (with versions) of libraries and plugins is in gradle/libs.versions.toml see this article
  • Common gradle configuration is shared in custom gradle plugins in build-logic

Libraries

List of librairies used in project:

  • JetPack Navigation
  • Coil to load image from URL
  • Koin for dependency injection
  • Kotlinx-serialization for Json de/derializer
  • Material3 for UI components and styles
  • OkHttp for HTTP calls
  • Retrofit for API calls
  • Room to persist local data in SQLite database
  • Timber for logging
  • For testing:
    • JUnit5 for unit tests
    • Mockk for mocking
    • Turbine for Flow test

Others versions:

There's some others versions of this application :

  • UI with View (XML) and Flow from data layer to presentation layer, branch.
  • UI with View (XML) and ViewModels (MVVM) transform Flow to LiveData for UI layer, branch.

albumexplorer's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.