This is a simple application that presents news information. The data is dynamically sourced from the News Api.
🗡️ This demonstrates modern Android development with Koin, Coroutines, Flow, Jetpack (Ktor, ViewModel), and Material Design based on Clean Architecture.
The app has a few screens located in multiple feature modules:
- News list screen - displays list of News
- News detail screen - display information about the selected news item
- Favourites screen - display list of news item which are stored in local app database
- Profile screen - empty (WiP)
This project takes advantage of best practices and 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
- Kotlin Flow - data flow across all app layers, including views
- Kotlin Symbol Processing - enable compiler plugins
- Kotlin Serialization - parse JSON
- Ktor - networking
- Jetpack
- Compose - modern, native UI kit
- Lifecycle - perform an action when lifecycle state changes
- ViewModel - store and manage UI-related data in a lifecycle-aware way
- Sqldelight - store offline cache
- Koin - dependency injection (dependency retrieval)
- 100% Kotlin
- Modern Architecture
- Clean Architecture
- Single activity architecture
- MVVM + MVI (presentation layer)
- Android Architecture components (ViewModel , Kotlin Flow
- Android KTX - Jetpack Kotlin extensions
- UI
- Reactive UI
- Jetpack Compose - modern, native UI kit (used for Fragments)
- Material Design 3 - application design system providing UI components
KMP-News-App is based on the MVVM architecture and the Repository pattern, which follows the Google's official architecture guidance.
The overall architecture of KMP-News-App 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:
Pokedex 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.
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.
KMP-News-App is an offline-first app is an app that is able to perform all, or a critical subset of its core functionality without access to the internet. So users don't need to be up-to-date on the network resources every time and it will decrease users' data consumption. For further information, you can check out Build an offline-first app.
Support it by giving a ⭐ to this repository.