Real world Android application demonstrating the use of JetPack Compose with Koin, Ktor,SqlDelight, Navigation Component and MVVM architecture.
Foody supports almost all screen sizes from phones in portrait and landscape to foldable phones and tablets. It also supports light and dark theme.
This project is using the API provided by themealdb.com
The project uses @PreviewScreenSizes
, @PreviewLightDark
and @PreviewFontScales
annotations from androidx.compose.ui:ui-tooling-preview
The preBuild depends on 2 tasks: ktlint and Detekt. You can manually run the tasks with ./gradlew ktlintFormat
and ./gradlew detekt
@Test
fun checkKoinModule() {
appModule.verify(
extraTypes = listOf(
io.ktor.client.engine.HttpClientEngine::class,
io.ktor.client.HttpClientConfig::class
)
)
}
ksp {
arg("KOIN_CONFIG_CHECK","true")
}
ImageLoader(this).newBuilder()
.memoryCachePolicy(CachePolicy.ENABLED)
.memoryCache {
MemoryCache.Builder(this)
.maxSizePercent(percent = 0.1)
.strongReferencesEnabled(true)
.build()
}
.diskCachePolicy(CachePolicy.ENABLED)
.diskCache {
DiskCache.Builder()
.maxSizePercent(percent = 0.03)
.directory(cacheDir)
.build()
}
.logger(DebugLogger())
.build()
- Kotlin - First class and official programming language for Android development.
- Jetpack Compose - Android’s modern toolkit for building native UI.
- Coroutines and Flow - Official Kotlin's tooling for performing asynchronous work.
- Android Jetpack - Jetpack is a suite of libraries to help developers build state-of-the-art applications.
- Navigation Compose - Navigation Compose is a framework for navigating between composables while taking advantage of the Navigation component’s infrastructure and features.
- Window size - Window size classes helps you design, responsive layouts.
- ViewModel - The ViewModel is designed to store and manage UI-related data in a lifecycle conscious way.
- StateFlow - StateFlow is a state-holder observable flow that emits the current and new state updates to its collectors.
- Koin - A pragmatic lightweight dependency injection framework.
- SqlDelight - Generates typesafe Kotlin APIs from your SQL statements.
- Ktor - An asynchronous framework for creating microservices, web applications and more.
- Coil - An image loading library for Android backed by Kotlin Coroutines.
- Kotlinx Serialization - Provides an easy-to-use API and supports a wide range of formats for reflection-less serialization.
- Material 3 - The latest version of Google’s open-source design system.
- Android Architecture Components - Collection of libraries that help you design robust, testable, and maintainable apps.
- Material Components for Android - Modular and customizable Material Design UI components for Android.
- Gradle Version Catalog - Maintain dependencies and plugins in a scalable way.
- Ktlint - A library for formatting Kotlin code according to official guidelines.
- Detekt - A static code analysis library for Kotlin.
- MockEngine - HttpClientEngine for writing tests without network.
- Kover - a set of solutions for collecting test coverage of Kotlin code compiled for JVM and Android platforms.