This is a sample project that presents a modern approach to Android application development.
The goal of the project is to combine popular libraries/tools and demonstrate best developement practices by utilizing up to date tech-stack and presenting modern Android application Architecture that is modular, scalable, maintainable, and testable. This application may look simple, but it has all the pieces that will provide the rock-solid foundation for the larger app suitable for bigger teams and long application lifecycle.
This project is being maintained to match industry standards.
Project characteristics and tech-stack
This project takes advantage of best practices, many popular libraries and tools in the Android ecosystem. Most of the libraries are in the stable version unless there is a good reason to use non-stable dependency.
- Tech-stack
- 100% Kotlin + Coroutines - perform background operations
- Retrofit - networking
- Jetpack
- Navigation - in-app navigation
- LiveData - notify views about database change
- Lifecycle - perform an action when lifecycle state changes
- ViewModel - store and manage UI-related data in a lifecycle conscious way
- Room - store offline cache
- Kodein - dependency injection
- Coil - image loading library
- Lottie - animation library
- Stetho - application debugging
- Modern Architecture
- Clean Architecture (at feature module level)
- Single activity architecture using Navigation component
- MVVM + MVI (presentation layer)
- Dynamic feature modules
- Android Architecture components (ViewModel, LiveData, Navigation)
- Android KTX - Jetpack Kotlin extensions
- CI
- GitHub Actions
- Automatic PR verification including tests, linters and 3rd online tools
- Testing
- Unit Tests (JUnit 5 via android-junit5)
- UT Tests (Espresso)
- Mockk - mocking framework
- Kluent - assertion framework
- UI
- Material design
- Reactive UI
- Static analysis tools
- Gradle
- Gradle Kotlin DSL
- Custom tasks
- Plugins (SafeArgs, android-junit5)
- Dependency locks
- Versions catalog
Architecture
Feature related code is placed inside one of the feature modules. We can think about each feature as the reusable component, equivalent of microservice or private library.
The modularized code-base approach provides few benefits:
- better separation of concerns. Each module has a clear API., Feature related classes live in different modules and can't be referenced without explicit module dependency.
- features can be developed in parallel eg. by different teams
- each feature can be developed in isolation, independently from other features
- faster compile time
Package Structures
com.kl3jvi.mvvm_template # Root Package
├─ app
├─ buildSrc
├─ feature_home
└──feature_favorites