The News App is a simple application that presents information about various news across the countries. This data is dynamically fetched from newsapi.org .
The app has a few screens located in multiple feature modules:
- Home list screen - displays list of news
- News detail screen - display information about the selected news
- Search screen - empty (WiP)
- Favourites 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
- Retrofit - networking
- Jetpack
- Compose - modern, native UI kit
- Navigation - in-app navigation
- Lifecycle - perform an action when lifecycle state changes
- ViewModel - store and manage UI-related data in a lifecycle-aware way
- Room - store offline cache
- Koin - dependency injection (dependency retrieval)
- Coil - image loading library
- Lottie - animation library
- 100% Kotlin
- Modern Architecture
- Clean Architecture
- Single activity architecture using Navigation component
- MVVM + MVI (presentation layer)
- Android Architecture components (ViewModel , Kotlin Flow , Navigation)
- Android KTX - Jetpack Kotlin extensions
- UI
- Reactive UI
- Jetpack Compose - modern, native UI kit (used for Fragments)
- View Binding - retrieve XML view ids (used for NavHostActivity only)
- Material Design 3 - application design system providing UI components
- Theme selection
- Dark Theme - dark theme for the app (Android 10+)
- Dynamic Theming - use generated, wallpaper-based theme (Android 12+)
- CI
- GitHub Actions
- Automatic PR verification including tests, linters, and 3rd online tools
- Testing
- Unit Tests (JUnit 5 via android-junit5) - test individual classes
- Konsist - test code conventions and architectural rules
- UI Tests (Espresso) - test user interface (WiP)
- Mockk - mocking framework
- Kluent - assertion framework
- Static analysis tools (linters)
- Ktlint - verify code formatting
- Detekt - verify code complexity and code smells
- Android Lint - verify Android platform usage
- Gradle
- Gradle Kotlin DSL - define build scripts
- Custom tasks
- Gradle Plugins
- Android Gradle - standard Android Plugins
- Test Logger - format test logs
- SafeArgs - pass data between navigation destinations
- Android-junit5 - use JUnit 5 with Android
- Versions catalog - define dependencies
- Type safe accessors
- GitHub Boots
- Other Tools
- Charles Proxy - enabled network traffic sniffing in
debug
builds.
- Charles Proxy - enabled network traffic sniffing in
By dividing a problem into smaller and easier-to-solve sub-problems, we can reduce the complexity of designing and maintaining a large system. Each module is an independent build block serving a clear purpose. We can think about each feature as a reusable component, the equivalent of microservice or private library.
The modularized code-base approach provides a few benefits:
- reusability - enable code sharing and building multiple apps from the same foundation. Apps should be a sum of their features where the features are organized as separate modules.
- 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. We strictly control what is exposed to other parts of your codebase.
- features can be developed in parallel eg. by different teams
- each feature can be developed in isolation, independently from other features
- faster build time
Gradle versions catalog is used as a centralized dependency management third-party dependency coordinates (group, artifact, version) are shared across all modules (Gradle projects and subprojects).
The project enables the TYPESAFE_PROJECT_ACCESSORS
experimental Gradle feature to generate type-safe accessors to refer other projects.
// Before
implementation(project(":feature_album"))
// After
implementation(projects.featureAlbum)
Read related articles to have a better understanding of underlying design decisions and various trade-offs.
The interface of the app utilizes some of the modern material design components, however, is deliberately kept simple to focus on application architecture and project config.
There are a few ways to open this project.
Android Studio
->File
->New
->From Version control
->Git
- Enter
https://github.com/igorwojda/android-showcase.git
into URL field and pressClone
button
- Run
git clone https://github.com/sumitkahar992/PAGING_APP.git
command to clone the project - Open
Android Studio
and selectFile | Open...
from the menu. Select the cloned directory and pressOpen
button
It is recommended to install Detekt to Android Studio. To configure
the plugin open Android Studio preferences, open Tools
, open Detekt
and add detekt.yml configuration file.
- Material Theme Builder - generate dynamic material theme and see it in action
- Compose Material 3 Components - a list containing material components
- Core App Quality Checklist - learn about building the high-quality app
- Android Ecosystem Cheat Sheet - board containing 200+ most important tools
- Kotlin Coroutines - Use Cases on Android - most popular coroutine usages
Other high-quality projects will help you to find solutions that work for your project (random order):
- Compose Samples - repository contains a set of individual Android Studio
- Jetpack Compose Playground - This is a Jetpack Compose example project
- Now Android - fully functional Android app built entirely with Kotlin and Jetpack Compose
- WhatsApp Clone Compose - WhatsApp clone app built with Jetpack Compose and Stream Chat SDK for Compose projects to help you learn about Compose in Android
- Iosched - official Android application from google IO 2019 and 2021
- Android Architecture Blueprints v2 - a showcase of various Android architecture approaches to developing Android apps
- Github Browser Sample - multiple small projects demonstrating usage of Android Architecture Components
- Clean Architecture Boilerplate - clean architecture for Android
- Roxie - a solid example of a
common state
approach together with very good documentation - Kotlin Android Template - the template that lets you create preconfigured Android Kotlin project in a few seconds
This project is being maintained to stay up to date with leading industry standards. Please check the CONTRIBUTING page if you want to help.