A robust and scalable Android project template designed to kickstart your app development with best practices and modern architecture components.
- Features
- Screenshots
- Why This Template?
- Who Is It For?
- Getting Started
- Project Structure
- Testing
- Contributing
- License
This template incorporates a comprehensive set of modern Android development tools and architectural patterns to ensure your project is maintainable, testable, and scalable.
General:
- Jetpack Compose: Build expressive and flexible UIs with Jetpack Compose.
- Reactive Programming: Implement reactive UIs using Kotlin Flow and Coroutines for efficient asynchronous operations.
Architecture:
- Single-Activity Architecture: Utilize a single-activity setup with Navigation Compose for seamless navigation.
- MVVM Pattern: Separate concerns with a clear ViewModel for each screen or feature.
- Data Layer:
- Repository Pattern: Abstract data sources with a repository.
- Local Data Source: Persist data locally using Room.
- Remote Data Source: Simulate remote data interactions with a fake remote source.
- Product Flavors:
- mock: Ideal for development and testing with mock data.
- prod: Production-ready configuration.
- Learn more about product flavors.
- Dependency Injection: Manage dependencies effortlessly with Hilt.
Additional:
- Authentication Service: Integrated authentication mechanism to manage user sign-in and sign-up processes securely.
- Notification Service: Implement push and local notifications to keep users engaged and informed.
- Logging with Timber: Utilize Timber for efficient and manageable logging throughout the application.
- Comprehensive Testing:
- Unit Tests: Validate individual components.
- Integration Tests: Ensure modules work together seamlessly.
- End-to-End (E2E) Tests: Test the complete flow on emulators or devices.
This template is designed to strike a balance between simplicity and complexity. It’s straightforward enough for quick understanding and easy to navigate, yet robust enough to demonstrate advanced architectural decisions and comprehensive testing strategies.
- Beginner to Intermediate Developers: Looking for a solid foundation to structure their Android apps in a maintainable and testable manner.
- Advanced Developers: Seeking a reference for best practices and modern architectural patterns in Android development.
- Teams: Needing a standardized template to ensure consistency and quality across projects.
- Android Studio: Latest version recommended.
- Git: Ensure Git is installed on your machine. Download Git.
- Java Development Kit (JDK): Version 11 or higher. Download JDK.
-
Clone the Repository
git clone [email protected]:dvird/android-template-starter.git
-
Open in Android Studio
- Launch Android Studio.
- Select Open an existing project.
- Navigate to the cloned repository's root directory and open it.
-
Sync and Build
- Allow Android Studio to sync the project and download all necessary dependencies.
- Once synced, build the project to ensure everything is set up correctly.
-
Run the App
- Select your preferred emulator or connected device.
- Click the Run button to launch the app.
android-template-starter/
todoapp/
├── data/
│ ├── task/
│ ├── user/
│ └── AppDatabase.kt
├── domain/
│ ├── task/
│ ├── user/
│ └── THIS_MODULE_IS_OPTIONAL.md
├── module/
│ ├── home/
│ ├── intro/
│ └── splash/
├── navigation/
│ ├── home/
│ ├── intro/
│ ├── splash/
│ ├── MainNavController.kt
│ ├── MainNavGraph.kt
│ └── MainNavigation.kt
├── service/
│ ├── auth/
│ └── notification/
├── support/
│ ├── di/
│ └── util/
├── Async.kt
└── TodoApplication.kt
This template emphasizes a strong testing strategy to ensure code reliability and quality.
- Unit Tests: Located in
tests/unit/
, these tests cover individual components and logic. - Integration Tests: Found in
tests/integration/
, these tests verify interactions between modules. - End-to-End (E2E) Tests: Reside in
tests/e2e/
, simulating real user scenarios on emulators or devices.
-
Unit and Integration Tests
./gradlew test
-
E2E Tests
./gradlew connectedAndroidTest
Contributions are welcome! Whether it's reporting issues, suggesting features, or submitting pull requests, your input helps improve this template.
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your message"
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
Please ensure your contributions adhere to the project's coding standards and include relevant tests.
This project is licensed under the MIT License.
Happy Coding!