- Notifications
You must be signed in to change notification settings - Fork2
📱 A simple GitHub template to quickly set up an Android project using Kotlin and Jetpack Compose, getting you up and running in just seconds. Perfect for starting new apps with modern Android UI.
License
ashtanko/compose-android-template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A modern, production-ready Android template built withJetpack Compose andKotlin. This template provides a solid foundation for building Android applications with best practices, comprehensive testing, and CI/CD already configured.
- Click theUse this template button to create a new repository
- Clone your new repository
- Update the following files with your project details:
buildSrc/src/main/kotlin/dev/shtanko/template/Configuration.kt- Update version and SDK configurationsapp/src/main/AndroidManifest.xml- Update package name and permissionslibrary-android/src/main/AndroidManifest.xml- Update package name- Rename package directories to match your project structure
# Build the project./gradlew build# Run tests./gradlewtest# Run linting and code analysis./gradlew detekt# Format code./gradlew spotlessApply
This template follows a modular architecture with the following structure:
├── app/ # Main Android application module├── library-android/ # Android library module├── library-kotlin/ # Kotlin-only library module├── buildSrc/ # Build configuration and dependencies├── gradle/ # Version catalogs and build scripts├── config/ # Static analysis configuration└── .github/workflows/ # CI/CD workflows- app: Main Android application with Compose UI
- library-android: Reusable Android components and utilities
- library-kotlin: Platform-agnostic business logic and data models
- Kotlin - Primary programming language
- Jetpack Compose - Modern UI toolkit
- Material 3 - Design system
- Android Gradle Plugin 8.10.1 - Build system
- Gradle Kotlin DSL - Build configuration
- Hilt - Dependency injection
- Room - Local database
- Retrofit + OkHttp - Network communication
- Kotlinx Serialization - JSON serialization
- Paging 3 - Pagination support
- Navigation Compose - Navigation
- WorkManager - Background tasks
- Coil - Image loading
- JUnit 5 - Unit testing
- Espresso - UI testing
- Robolectric - Android framework testing
- Mockito/MockK - Mocking
- Turbine - Flow testing
- Roborazzi - Screenshot testing
- Detekt - Static code analysis
- KtLint - Code formatting
- Spotless - Code formatting
- SonarQube - Code quality analysis
- Kover - Code coverage
- Jacoco - Coverage reporting
- Material 3 Design System - Modern, adaptive design
- Dark/Light Theme Support - Complete theming system
- Responsive Layout - Adaptive to different screen sizes
- Accessibility Support - WCAG compliance ready
- Splash Screen - Modern splash screen implementation
- Hot Reload - Fast development with Compose
- Type Safety - Full Kotlin type safety
- Auto-completion - Enhanced IDE support
- Debug Tools - Comprehensive debugging utilities
- Baseline Profiles - Performance optimization
- Benchmarking - Performance measurement tools
- Memory Leak Detection - Built-in memory analysis
- ProGuard/R8 - Code optimization and obfuscation
The project uses centralized dependency management throughgradle/libs.versions.toml:
// Example dependency usageimplementation(libs.androidx.compose.ui)implementation(libs.androidx.navigation.compose)implementation(libs.hilt.android)Configure code quality tools in their respective config files:
- Detekt:
config/detekt/detekt.yml - KtLint: Configured via Gradle plugin
- Spotless: Configured in
build.gradle.kts
The template includes GitHub Actions workflows for:
- Build & Test: Automated testing on every PR
- Code Quality: Static analysis and formatting checks
- Publishing: Automated library publishing (configurable)
# Run all unit tests./gradlew testDebugUnitTest# Run tests with coverage./gradlew koverHtmlReport
# Run Espresso tests./gradlew connectedAndroidTest# Run screenshot tests./gradlew updateDebugScreenshotTest./gradlew validateDebugScreenshotTest
# Run static analysis./gradlew detekt# Check code formatting./gradlew ktlintCheck# Apply code formatting./gradlew spotlessApply
The template is configured for publishing to Maven Central. Configure the following secrets:
| Secret | Description |
|---|---|
ORG_GRADLE_PROJECT_NEXUS_USERNAME | Sonatype username |
ORG_GRADLE_PROJECT_NEXUS_PASSWORD | Sonatype password |
ORG_GRADLE_PROJECT_SIGNING_KEY | GPG private key |
ORG_GRADLE_PROJECT_SIGNING_PWD | GPG passphrase |
- Snapshot Publishing: Automatic on merge to main
- Release Publishing: Triggered by version tags
Use the provided Makefile for common tasks:
# Build and test everythingmake default# Run code quality checksmake check# Format codemake spotless# Generate coverage reportmake kover# Run screenshot testsmake screenshot
- Android Studio - Latest stable version
- JDK 17 - Java Development Kit
- Android SDK - API level 33+ (Android 13+)
- Gradle - 8.0+ (included via wrapper)
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and quality checks
- Submit a pull request
- Follow Kotlin coding conventions
- Write unit tests for new features
- Ensure all CI checks pass
- Update documentation as needed
This project is licensed under the Apache License 2.0 - see theLICENSE file for details.
- Built on top of the excellentkotlin-android-template
- Uses modern Android development best practices
- Incorporates community-driven improvements
Ready to build amazing Android apps? 🎉 Start with this template and focus on what matters most - your app's features and user experience!
About
📱 A simple GitHub template to quickly set up an Android project using Kotlin and Jetpack Compose, getting you up and running in just seconds. Perfect for starting new apps with modern Android UI.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.