App Toolkit for Android

Android Kotlin Android Studio GitHub GPLv3 license

Android CI Release

App Toolkit for Android is a modular collection of reusable Android foundations, feature screens, integrations, and navigation components. The repository also includes an installable sample app that demonstrates the library in a real application.

Repository structure

  • library/apptoolkit is the host-facing entry point. It exports the toolkit modules, assembles their Koin modules, and registers the Toolkit's pages with toolkitGraph { }.
  • library/core contains shared models, data, design-system, networking, testing, and UI foundations.
  • library/feature contains reusable features: About, Advanced settings, Changelog, Developer options, Diagnostics, Display, Help, Issue Reporter, Licenses, Onboarding, Permissions, Privacy, Settings, Support, and Theme.
  • library/integration contains optional integrations for ads, billing, consent, Firebase, in-app review, and in-app updates.
  • library/navigation is the navigation core of the one-activity shell: the graph an app describes, the navigator, the page and list-detail scenes, the transitions and predictive back, and the Toolkit's route keys.
  • library/shell hosts the graph in the app's one activity: the app bar, navigation bar, rail, drawers, overflow menu, banner and player.
  • sample documents the sample application and its user-facing features.

Each module has a README describing its responsibilities, dependencies, public contracts, and known risks.

CI

The Android CI workflow runs the build and tests independently of CodeQL.

Advanced CodeQL analysis is optional while its Kotlin support catches up with the project's toolchain. Run the CodeQL workflow manually, or set the repository Actions variable ENABLE_ADVANCED_CODEQL to true to enable its automatic runs. Disable GitHub's default CodeQL setup before using advanced analysis, because GitHub rejects advanced analysis uploads while default setup is enabled. CodeQL failures remain non-blocking and do not change the Kotlin version.

Use the library

App Toolkit is published through JitPack. Add JitPack to the dependency repositories in settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven(url = "https://jitpack.io")
    }
}

Add the toolkit artifact to the consuming module:

dependencies {
    implementation("com.github.MihaiCristianCondrea.App-Toolkit-for-Android:apptoolkit:3.0.0-pre32")
}

The published version is maintained as PUBLISHING_VERSION in gradle.properties. For host configuration, dependency-injection entry points, and navigation integration details, see the :library:apptoolkit documentation.

Upgrading from 2.x? The 3.0.0 migration guide maps the removed navigation APIs to the shell that replaces them.

Explore the sample

The sample app is both a component showcase and a collection of practical utilities. Its feature list, screenshots, Play Store link, and usage overview live in the sample README. Implementation details for its application composition root are in sample/app/README.md.

Sample Architecture

App Toolkit uses a modular, layered architecture designed for scalability and maintainability.

The sample follows one dependency direction: :sample:app composes independent feature, core, integration, and widget modules. Reusable modules never depend back on the app.

Module typePathResponsibility
App:sample:appAndroid packaging, startup, the complete DI graph, navigation aggregation, and cross-feature bridges.
Core:sample:core:*Neutral contracts and capabilities reused by multiple features.
Core:sample:core:apptoolkitToolkit module ordering and host-wide defaults, with feature provider modules supplied by the app.
Feature:sample:feature:*A user-facing vertical slice, including its routes, state, data ownership, and DI bindings.
Integration:sample:integration:*Host configuration for an external or reusable SDK boundary.
Widget:sample:widgetHome-screen widget UI, receiver, and widget-specific data access.

Each module has a local README.md that documents its ownership, dependencies, public contracts, important flows, and current risks. Package trees start at the module namespace. Feature modules organize implementation directly into the layers they actually use:

feature/my-feature/src/main/kotlin/com/.../feature/myfeature/
├── data/       # repositories, data sources, data models, and data mappings
├── domain/     # optional domain models, mappings, and use cases
├── ui/         # screens, ViewModels, state, navigation, and UI components
└── di/         # dependency injection bindings

Do not add empty layers. Repository contracts stay beside their implementations in data, and a domain layer is added only when the feature has domain-specific models or reusable business logic. New feature modules use the com.mihaicristiancondrea.android.apptoolkit.sample-module convention plugin and depend only on the core, integration, and library modules they need. Features never depend on sibling features.

A feature owns and exports its route key, route identifier, screen, and Koin module. It does not register itself. :sample:app declares the graph (tabs, pages, drawer and overflow entries), startup choices, and cross-feature adapters because it is the only module allowed to see the whole feature set. Route identifiers are declared once and referenced through their route constants.

The build enforces these boundaries:

  • Core and integration modules cannot depend on feature modules.
  • Feature modules cannot depend on sibling features.
  • Core, feature, and integration modules cannot depend on :sample:app.
  • Kotlin packages cannot be split across sample modules.
  • App composition packages cannot be imported from reusable sample modules.
  • Core modules cannot import feature implementations.
  • Analytics screen names come from AppScreenTracking, not inline literals.
  • A feature builds its analytics events only in its own ui/analytics package.

The library has rules of its own: shared library modules (core, integration, navigation and shell) cannot depend on features or on :library:apptoolkit, the library never depends on the sample, library packages are not split, and library features cannot depend on each other beyond the edges listed in ModuleBoundariesPlugin, which shrink as each feature moves to the shell graph.

Run ./gradlew checkModuleBoundaries to execute the repository-wide source checks. These targeted guards complement compilation, unit tests, lint, and on-device validation.

The current modularization keeps runtime and tests on the same sampleAppModules DI declaration. Feature Android components are declared by their owning manifests, advertising configuration lives in :sample:integration:ads, and :sample:core:analytics keeps only the analytics vocabulary features share: the GA4 recommended events and the screen registry. Each feature owns its own events, parameters and builders in its ui/analytics package, so the shared module does not grow with every feature; apps built on the Toolkit are encouraged to do the same. The app remains the intentional merge point for the final manifest, runtime graph, and complete destination set. This can produce conflicts when several destinations are added at once, and the shared sample convention still enables Compose for contract-only sample modules. Existing boundary checks reduce these risks but do not replace feature-specific tests.

Build and test

This project uses the Gradle wrapper. From the repository root:

./gradlew build

Run the sample app with Android Studio or install a debug build on a connected device with:

./gradlew :sample:app:installDebug

Generate the published library API reference from the repository root.

./gradlew :dokkaGenerate

Serve build/dokka/html with a local HTTP server and open its index. The reference covers public declarations from the release variants of published library modules, including each module README. The documentation homepage uses this README. The dokka-plugins:site plugin generates the Markdown exports in the same Gradle run. Mermaid diagrams render in the browser using jsDelivr.

Android CI runs the same command and publishes the documentation site on pushes to develop. The docs job also uploads the library-api-reference artifact.

Contributing

Please read the Code of Conduct and follow the existing module architecture and conventions when proposing changes. Security issues should be reported according to SECURITY.md.

License

This project is distributed under the GNU General Public License v3.0. See LICENSE.md for the complete terms.

All modules:

Link copied to clipboard

Acts as the host-facing entry point and composition root for reusable AppToolkit features. It assembles Koin modules and the Toolkit's pages of the shell graph while re-exporting the toolkit modules through Gradle api dependencies.

Link copied to clipboard

Holds low-level contracts, domain result types, host configuration, dispatchers, constants, and Android utility abstractions shared across the toolkit.

Link copied to clipboard

Provides the single Toolkit Preferences DataStore file and preferences shared by several modules. Capability-specific sources live with their owning features or integrations.

Link copied to clipboard

Defines the AppToolkit Compose theme, typography, color palettes, dynamic wallpaper colors, theme-selection visuals, and the shared icon slot used by navigation items and buttons.

Link copied to clipboard

Supplies the shared Ktor HTTP client and the translation of its failures into NetworkException.

Link copied to clipboard

Provides the reusable Compose presentation foundation: screen/ViewModel contracts, the shell's page frame, state handling, analytics hooks, and shared components.

Link copied to clipboard

Owns the AppToolkit About screen: host application, App Toolkit, and Google Play services metadata, plus the tap-to-copy interaction for the entries it renders and the version-tap easter egg.

Link copied to clipboard

Owns the advanced settings page: the bug report entry, clearing the app's cache, and the developer options entry once it is unlocked.

Link copied to clipboard

Owns changelog retrieval and presentation: the package-aware Markdown fetch, its legacy fallback, and the bottom sheet that renders it.

Link copied to clipboard

The developer options page, the shell's laboratory: every override that forces, compares or exercises the shell's layout, bars, navigation, motion and accessories, applied while the app runs, and a live readout of the state the shell is in. Changes apply at once and persist, so the app can be restarted into a variation. The person's own preferences are display settings instead, in :library:feature:display.

Link copied to clipboard

Lets a person choose what the app reports and shares: the usage and diagnostics switch, and the analytics and advertising consents behind it, on a settings page and on an onboarding page.

Link copied to clipboard

Draws the display settings page: the person's own preferences. The dark theme and dynamic colors, bouncy buttons, the startup page, the navigation labels and the language, each only where it means something in the app. The shell's own variations are developer options, in :library:feature:developer.

Link copied to clipboard

Owns the FAQ surface end to end: the catalog behind it, the screen that lists it, and the contact, review, and store actions around it. This module replaced :library:feature:help in 3.0.0.

Link copied to clipboard

Collects device/report data and submits structured issues to a configured GitHub repository.

Link copied to clipboard

Owns the open-source licenses surface: the list of bundled libraries, its shell page, and the AboutLibraries metadata that backs them.

Link copied to clipboard

Owns the multi-page onboarding flow of a first launch, including theme choice and completion persistence. It is a start screen of the shell, drawn before its tabs, and follows the startup screen of :library:feature:startup.

Link copied to clipboard

Displays a localized explanation of the permissions used by AppToolkit hosts.

Link copied to clipboard

Owns the privacy and legal preference surface: policy links, the host destinations reached from it, and the strings that name them.

Link copied to clipboard

Draws the Toolkit's settings list: the categories and rows an app's SettingsProvider describes, each row opening its destination in the shell.

Link copied to clipboard

Owns the startup screen, the first start screen of a first launch: it asks for the host's runtime permissions and the consent form, then hands over to onboarding. It is a start screen of the shell, drawn before its tabs.

Link copied to clipboard

Presents donation/support products and coordinates purchases through the billing integration.

Link copied to clipboard

Owns the theme settings page and the seasonal themes: the color palette, theme mode and AMOLED choices, the holiday greeting, the holiday snowfall, the weather effect, and what the About screen's easter egg unlocks.

Link copied to clipboard

Owns ad enablement settings and Google Mobile Ads integration UI used by AppToolkit hosts.

Link copied to clipboard

Wraps Google Play Billing behind a reusable repository and Koin module.

Link copied to clipboard

Coordinates user consent state between persisted toolkit preferences and Google's User Messaging Platform (UMP).

Link copied to clipboard

Implements the toolkit's Firebase analytics/crash-reporting contract and provides Firebase messaging service wiring.

Link copied to clipboard

Exposes installed Google Play services metadata through a main-safe repository.

Link copied to clipboard

Encapsulates Google Play in-app review eligibility, prompting, and persisted request throttling.

Link copied to clipboard

Encapsulates Google Play in-app update checks and update-flow launches behind a repository contract.

Link copied to clipboard

Holds the navigation core of the one-activity shell: the graph an app describes, the navigator that moves through it, the scenes that lay pages out, and the transitions and predictive back that move between them. It also owns the Toolkit's route keys.

Link copied to clipboard

Hosts an app's ShellGraph in its one activity: ShellHost draws every tab, page, bar, rail, drawer and transition the graph describes. It is the chrome around the navigation core of :library:navigation, drawn with the Toolkit's own components.