Now in Android Sample App

repository·main·Indexed 12 days ago

https://github.com/android/nowinandroid

A sample Android application demonstrating best practices in modular architecture. The project features a layered structure consisting of feature modules, core modules (such as :core:data, :core:domain, and :core:designsystem), and a sync module. It utilizes a custom 'build-logic' included build with composable convention plugins for Gradle configuration, including specific plugins for Android applications, libraries, and Jetpack Compose.

Tokens
9.5K
Snippets
11
Records
57
Agent score
96%

What's inside Now in Android

  1. Overview of `:feature:foryou:api` module

    main
    The :feature:foryou:api module is an Android library that serves as the public API surface for the 'For You' feature. It is part of the :feature layer and depends on the :core:navigation module. This separation allows other modules to interact with the 'For You' feature via its API without needing to depend on its internal implementation details.
  2. Overview of :feature:bookmarks:impl

    main

    The :feature:bookmarks:impl module is the implementation layer for the bookmarks feature. It contains the internal logic, UI components, and data handling required to support bookmarking functionality within the app.

    In the project's modular architecture, this module is separated from its public API (:feature:bookmarks:api) to ensure that implementation details are not leaked to other features. It depends on several core modules for data management, design system components, and UI building blocks.

  3. Overview of the `:core:model` module

    main
    The :core:model module is a pure JVM library within the :core layer of the project. It serves as a central location for defining domain models that are shared across different layers and features of the application. Because it is a JVM library, it does not depend on Android-specific APIs, making it highly portable and suitable for use in both Android and pure Kotlin/JVM environments.
  4. Overview of `:core:navigation` module

    main
    The :core:navigation module is a core Android library within the project responsible for handling navigation logic. It serves as a centralized library that other modules (such as feature modules or the application module) depend on to facilitate navigation across the app.
  5. Overview of the `:lint` module

    main
    The :lint module in this project is responsible for managing linting configurations and rules. It serves as a centralized location for linting logic that is applied across the repository to ensure code quality and consistency.
  6. Overview of the :core:database module

    main

    The :core:database module is an Android library within the :core layer of the project. It is responsible for database-related concerns and depends on the :core:model JVM library.

    In the project's architecture, :core:database provides the data persistence implementation, while :core:model defines the data structures used across the application.

  7. Overview of the :core:data module

    main

    The :core:data module serves as the central data layer orchestration component within the :core layer of the project. It acts as a mediator that integrates various data sources, including local databases, datastores, and network services, to provide a unified data interface for the rest of the application.

    Module Dependencies

    To implement or extend data logic, understand that :core:data depends on the following modules:

    • Direct Dependencies:

      • :core:analytics (via implementation/api)
      • :core:common (via implementation/api)
      • :core:database (via implementation/api)
      • :core:datastore (via implementation/api)
      • :core:network (via implementation/api)
      • :core:notifications (via implementation/api)
    • Transitive/Downstream Dependencies (via its dependencies):

      • :core:model (used by :core:database, :core:datastore, :core:network, and :core:notifications)
      • :core:datastore-proto (used by :core:datastore)
  8. Overview of the :benchmarks module

    main
    The :benchmarks module is an android-test type module used for performance benchmarking within the project. It interacts with the :app module via baselineProfile and receives testedApks from it. This module is central to measuring and maintaining the performance characteristics of the application.