๐ Notes App built with MVVM pattern using Jetpack Compose, Coroutines, Hilt and Room
- Minumum SDK Level: 21
- 100% Kotlin
- Architecture
- MVVM Pattern: Industry-recognized software architecure pattern supported by Google
- Jetpack Compose: Modern toolkit for building Android user interfaces using a declarative programming model
- ViewModel: Exposes data streams as a state holder
- Hilt: Dependency injection library built on top of Dagger benefit from the compile-time correctness, runtime performance, scalability, and Android Studio support
- Coroutines: Concurrency design pattern provided by Kotlin
My Notes demonstrates MVVM architecture by separating multiple app components into two main layers - UI and Data. Following the core Android design principles, the app is scalable, maintainable and testable.
- Architectural Principles
- Separations of concerns
- Drive UI from data models
- Single source of truth
- Unidirectional Data Flow
Pokedex App follows the unidirectional data flow by adapting architectural layering. The app responds accordingly to user events and update ui states.
UI layer displays the application data and serves as the primary point for user interactions. Whenever the app data changes, the UI should update to reflect changes made by either user interaction or external input.
- The main activity hosts the navigation controller and navigates through two screens - PokemonListScreen and PokemonDetailScreen depending on user interactions.
- PokemonListViewModel requests data to the data layer and PokemonListScreen updates UI observing states held by ViewModel.
- PokemonDetailViewModel is responsible for fetching pokemon details and updates states for PokemonDetailScreen.
Domain layer is reponsible for containing application data and business logics. The data layer is consisted of repositories and data sources. It is important to keep each repository as a single source of truth.
- PokemonRepository is a single source of truth and requests data from the remote data source.
- PokemonRepository requests network responses to PokeAPI server using Retrofit library.
Data layer is reponsible for containing application data and business logics. The data layer is consisted of repositories and data sources. It is important to keep each repository as a single source of truth.
- PokemonRepository is a single source of truth and requests data from the remote data source.
- PokemonRepository requests network responses to PokeAPI server using Retrofit library.
This project was built to understand how to build a clean architecture Jetpack Compose app using differnt types of Android libraries.