Album Explorer project shows modern Android development, following Android design and development best practices. It's inspired by NowInAndroid project and Guide to app architecture.
- Add Paging library for view and local datasource, by the way remote datasource is a JSon mock not paginated ๐
- Add instrumented test on UI
- Put
com.lyh.albumexplorer.feature.album.util
classes in a new modulefeature-code-test
- Create a custom Gradle Plugin for
java-library
module, and use it instead ofcom.android.library
in modules don't have Android dependencies asdata-remote
,data
, ... - Create a custom Gradle Plugin for
compose
module - Manage [large screen] (https://developer.android.com/guide/topics/large-screens/get-started-with-large-screens)
- Use
SavedStateHandle
for passing parameters to screen whe [bug] (InsertKoinIO/koin#1350) fixed
Application uses:
- Clean Architecture for separate business logic [domain], services (storage, API, ...) [data] and [presentation] layers
- MVVM (Model-View-ViewModel) design pattern for presentation layer
Clean Archi and MVVM help:
- to avoid or reduce dependencies between layers (separation of concerns)
- to test easily
- to have uniform way to develop
- ...
Clean Architecture stack uses Flow to stream data, from data layer to presentation layer.
UI use Jetpack Compose.
- app [clean-archi/presentation]: Single-Activity and Application classes
- feature-album: feature showing album data, using MVVM pattern
- feature-core: common classes and resources (styles, strings, drawable) for feature modules
- build-logic : for gradle plugins, to share common configuration
- data [clean-archi/data]: repositories
- data-local: to store and access data locally
- data-remote: for API calls
- domain [clean-archi/domain]: for business logic, use-case
- data: unit tests on repository and helper
- data-local : Instrumented tests for use in-memory Room database
- data-remote: unit tests on helper
- domain: unit tests on use-case
- app
- feature-album : unit tests on view-model
- Project uses Gradle build system with Kotlin DSL (kts).
- Catalog (with versions) of libraries and plugins is in
gradle/libs.versions.toml
see this article - Common gradle configuration is shared in custom gradle plugins in build-logic
List of librairies used in project:
- JetPack Navigation
- Coil to load image from URL
- Koin for dependency injection
- Kotlinx-serialization for Json de/derializer
- Material3 for UI components and styles
- OkHttp for HTTP calls
- Retrofit for API calls
- Room to persist local data in SQLite database
- Timber for logging
- For testing:
- JUnit5 for unit tests
- Mockk for mocking
- Turbine for Flow test
There's some others versions of this application :