A modern, production-ready Android template built with Jetpack Compose, Navigation 3, and Kotlin. This template provides a solid foundation for building Android applications with best practices, comprehensive testing, and CI/CD already configured.
-
Click the Use this template button.
-
Clone your new repository.
-
Run the rename script to replace template package names, applicationId, plugin aliases, folder structure, and (optionally) copyright headers with your own:
# preview first ./scripts/rename-template.sh \ --package com.example.myapp \ --name "My Awesome App" \ --author "Your Name" \ --dry-run # apply ./scripts/rename-template.sh \ --package com.example.myapp \ --name "My Awesome App" \ --author "Your Name"
Or via Gradle (same flags,
-P-style):./gradlew renameProject \ -Ppackage=com.example.myapp \ -Pname="My Awesome App" \ -Pauthor="Your Name" \ -PdryRun=true # drop this to applyAfter applying, run
./gradlew spotlessApplythen./gradlew clean assembleDebugto verify. -
Update SDK and library versions in
gradle/libs.versions.tomlas needed (single source of truth for dependencies and plugin versions).
# Build the project
./gradlew assembleDebug
# Run unit tests
./gradlew test
# Run linting and static analysis
./gradlew detekt
# Format code
./gradlew spotlessApplyThe project follows a modular layout backed by Gradle convention plugins:
βββ app/ # Main Android application (Compose + Navigation 3)
βββ library-android/ # Android-specific library module
βββ library-kotlin/ # Pure Kotlin library module (business logic)
βββ benchmarks/ # Macrobenchmark + baseline profile generator
βββ build-logic/ # Shared Gradle convention plugins (includeBuild)
βββ buildSrc/ # Project-wide build configuration
βββ gradle/ # Version catalog (libs.versions.toml)
βββ config/ # Detekt / KtLint / static-analysis configs
βββ spotless/ # Spotless copyright header template
βββ scripts/ # Helper scripts (e.g. rename-template.sh)
Convention plugins under build-logic/convention (e.g. androidlab.android.application, androidlab.android.library.compose, androidlab.hilt, androidlab.android.room, androidlab.android.lint) keep per-module build.gradle.kts files small and consistent.
- Kotlin 2.3.21 β with Strong Skipping support.
- Android Gradle Plugin 9.2.1 β latest build system features.
- Jetpack Compose β Compose BOM
2026.05.00, Material 3, Material 3 Adaptive. - Navigation 3 (
1.1.1) alongsideandroidx.navigation:navigation-compose(2.9.8). - Kotlin Coroutines 1.11.x and kotlinx.serialization 1.11.x.
- Hilt 2.59.2 β dependency injection (+
hilt-navigation-compose). - Room 2.8.x β local persistence (via KSP).
- Retrofit 3.0.0 + OkHttp 5.3.x β type-safe networking with
kotlinx-serializationconverter. - Sandwich 2.2.x β Retrofit response wrapping.
- Paging 3 β smooth list loading.
- Coil 2.7 β image loading optimized for Compose.
- kotlinx-datetime and kotlinx.collections.immutable.
- JUnit 5 (6.0.x) β modern unit testing.
- Roborazzi 1.60.x β screenshot / golden-image testing.
- Compose Guard β Compose compiler stability metrics.
- Kover 0.9.x + JaCoCo 0.8.x β coverage reports.
- Detekt 1.23.x + KtLint + Spotless 8.4.x β static analysis & formatting.
- Dependency Guard β transitive dependency change detection.
- MockK + Mockito + Turbine + Truth + AssertJ β testing toolkit.
- Robolectric & Espresso β JVM- and device-side instrumentation.
- Adaptive Layouts β foldables and tablets via Material 3 Adaptive.
- Edge-to-Edge β modern UI implementation by default.
- Baseline Profiles β generated via
:benchmarksfor faster startup and smoother frames. - Screenshot Testing β automated UI regression with Roborazzi + the Compose screenshot plugin.
- Dependency Guard β locks transitive dependency surface across builds.
- Signing-ready β release
signingConfigresolves keystore credentials from env vars on CI (SIGNING_STORE_PASSWORD,SIGNING_KEY_ALIAS,SIGNING_KEY_PASSWORD) orsecrets.defaults.propertieslocally.
# Run unit tests (JUnit 5)
./gradlew test
# Screenshot tests (Roborazzi)
./gradlew recordRoborazziDebug # record new baselines
./gradlew verifyRoborazziDebug # compare against baselines
# Coverage
./gradlew koverHtmlReport
# Instrumentation tests
./gradlew :app:connectedDebugAndroidTest
# Macrobenchmarks & baseline profile
./gradlew :benchmarks:connectedDebugAndroidTest
./gradlew :app:generateBaselineProfileThe Makefile wraps common Gradle invocations:
make/make defaultβbuild,test,lint,detekt, plusupdateDebugScreenshotTestandvalidateDebugScreenshotTest.make checkβ run Detekt.make ktlintβ run KtLint check.make spotlessβ run Spotless apply + check.make testβ JVM unit tests.make android-testβ:app:connectedDebugAndroidTest.make screenshotβ update + validate screenshot tests.make roboβ clear β record β compare β verify Roborazzi screenshots.make koverβ generate Kover HTML coverage report.make jacocoβ copy the JaCoCo HTML report tojacocoReport/.make guard-baselineβ refresh Dependency Guard baselines.make benchmarkβ run macrobenchmarks.make baseline-profileβ generate baseline profile for:app.make lines/make clocβ Kotlin LoC stats.
- Android Studio β Ladybug or newer.
- JDK 21 β required for the build system (set as Kotlin/Java toolchain).
- Android SDK β
compileSdk/targetSdk: 37,minSdk: 24. - Gradle β uses the wrapper (
./gradlew); AGP 9.2.x.
- Fork the repository.
- Create a feature branch.
- Ensure all CI checks pass.
- Submit a pull request.
This project is licensed under the Apache License 2.0 β see the LICENSE file for details.