Podii simulates a meal ordering application ...
podiiOne_1.mp4
- Minimum SDK level 21
- Kotlin based, Coroutines + Flow for asynchronous.
- Jetpack
- Lifecycle: Observe Android lifecycles and handle UI states upon the lifecycle changes.
- ViewModel: Manages UI-related data holder and lifecycle aware. Allows data to survive configuration changes such as screen rotations.
- View Binding: Binds UI components in your layouts to data sources in your app using a declarative format rather than programmatically.
- Architecture
- MVVM Architecture (View - View Binding - ViewModel - Model)
- Repository Pattern
- Moshi: A modern JSON library for Kotlin and Java.
- ksp: Kotlin Symbol Processing API.
- Material-Components: Material design components for building ripple animation, and CardView.
- Coil: Loading images from network.
PodiiOne is based on the MVVM architecture and the Repository pattern, which follows the Google's official architecture guidance.
The overrall architecture of Podii is composed of two layers; the UI layer and the data layer. Each layer has dedicated components and they have each different responsibilities, as defined below:
Podii was built with Guide to app architecture, so it would be a great sample to show how the architecture works in real-world projects.
- Each layer follows unidirectional event/data flow; the UI layer emits user events to the data layer, and the data layer exposes data as a stream to other layers.
- The data layer is designed to work independently from other layers and must be pure, which means it doesn't have any dependencies on the other layers.
With this loosely coupled architecture, you can increase the reusability of components and scalability of your app.
The UI layer consists of UI elements to configure screens that could interact with users and ViewModel that holds app states and restores data when configuration changes.
- UI elements observ the data flow via View Binding, which is the most essential part of the MVVM architecture.
- With View binding, which is an Android DataBinding kit for notifying data changes.
The data Layer consists of repositories, which include business logic, such as querying data from the local database and requesting remote data from the network. It is implemented as an offline-first source of business logic and follows the single source of truth principle.