All Projects → Kotlin → kmm-production-sample

Kotlin / kmm-production-sample

Licence: MIT license
This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.

Programming Languages

kotlin
9241 projects
swift
15916 projects

Projects that are alternatives of or similar to kmm-production-sample

kmm
Rick & Morty Kotlin Multiplatform Mobile: Ktor, Sqldelight, Koin, Flow, MVI, SwiftUI, Compose
Stars: ✭ 52 (-96.48%)
Mutual labels:  compose, kotlin-multiplatform, jetpack-compose, kmm
StarWars
Minimal GraphQL based Jetpack Compose, Wear Compose and SwiftUI Kotlin Multiplatform sample (using StarWars endpoint - https://graphql.org/swapi-graphql)
Stars: ✭ 165 (-88.82%)
Mutual labels:  kotlin-native, kotlin-multiplatform, jetpack-compose, kmm
CompleteKotlin
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.
Stars: ✭ 236 (-84.01%)
Mutual labels:  kotlin-native, kotlin-multiplatform, kmm
chip-8
Jetpack Compose and SwiftUI based Kotlin Multiplatform fork of https://github.com/cbeust/chip-8 (Chip-8 Emulator)
Stars: ✭ 36 (-97.56%)
Mutual labels:  kotlin-native, kotlin-multiplatform, jetpack-compose
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (-97.9%)
Mutual labels:  multiplatform, kotlin-native, kotlin-multiplatform
Aboutlibraries
AboutLibraries automatically detects all dependencies of a project and collects their information including the license. Optionally visualising it via the provided ui components.
Stars: ✭ 2,777 (+88.14%)
Mutual labels:  multiplatform, compose, kotlin-multiplatform
Lastik
Kotlin Multiplatform + Jetpack Compose pet project, based on www.last.fm/api (in development)
Stars: ✭ 37 (-97.49%)
Mutual labels:  kotlin-multiplatform, jetpack-compose, kmm
kinsight-multiplatform
Kotlin Multiplatform Concept - iOS, MacOS, WatchOS (SwiftUI), Android (phone and Wear OS), JVM Web Server - Alpha Capture
Stars: ✭ 38 (-97.43%)
Mutual labels:  kotlin-native, kotlin-multiplatform, jetpack-compose
tv-maniac
Tv-Maniac is a Multiplatform app (Android & iOS) for viewing TV Shows from TMDB.
Stars: ✭ 55 (-96.27%)
Mutual labels:  kotlin-multiplatform, jetpack-compose, kmm
me
A Jetpack Compose Kotlin Multiplatform WYSIWYG blog editor
Stars: ✭ 62 (-95.8%)
Mutual labels:  multiplatform, compose, jetpack-compose
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (-96.34%)
Mutual labels:  multiplatform, kotlin-native, kotlin-multiplatform
D-KMP-sample
D-KMP Architecture official sample: it uses a shared KMP ViewModel and Navigation for Compose and SwiftUI apps.
Stars: ✭ 636 (-56.91%)
Mutual labels:  kotlin-multiplatform, jetpack-compose, kmm
TMDbMultiplatform
Step-by-step guide on Kotlin Multiplatform
Stars: ✭ 86 (-94.17%)
Mutual labels:  kotlin-native, kotlin-multiplatform, kmm
ToDometer Multiplatform
WIP Kotlin Multiplatform project: A meter to-do list built with Android Jetpack, Compose UI Multiplatform, Wear Compose, SQLDelight, Koin Multiplatform, SwiftUI, Ktor Server / Client, Exposed...
Stars: ✭ 145 (-90.18%)
Mutual labels:  multiplatform, kotlin-multiplatform, jetpack-compose
Brick
🧱 Brick - Multiplatform navigation library for Compose.
Stars: ✭ 33 (-97.76%)
Mutual labels:  multiplatform, compose, jetpack-compose
Jetpack-compose-sample
Forget about bunch of XML files for maintaining UIs. Jetpack Compose is Android’s modern toolkit for building native UI. Here is a small example to get started.
Stars: ✭ 29 (-98.04%)
Mutual labels:  sample, compose, jetpack-compose
Compose Jb
Jetpack Compose for Desktop and Web, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Stars: ✭ 7,562 (+412.33%)
Mutual labels:  multiplatform, compose
kmm-integration-sample
No description or website provided.
Stars: ✭ 58 (-96.07%)
Mutual labels:  sample, kmm
Keemun
No description or website provided.
Stars: ✭ 13 (-99.12%)
Mutual labels:  multiplatform, kotlin-multiplatform
Apollo Android
🤖  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
Stars: ✭ 2,949 (+99.8%)
Mutual labels:  multiplatform, kotlin-multiplatform

KMM RSS Reader

This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.

Desktop and Web experiment

Desktop and Web clients were implemented as experimental features and can be viewed here.

Project structure

This repository contains a common Kotlin Multiplatform module, a Android project and an iOS project. The common module is connected with the Android project via the Gradle multi-project mechanism. For use in iOS applications, the shared module compiles into a framework that is exposed to the Xcode project via the internal integration Gradle task. This framework connects to the Xcode project that builds an iOS application.

You can achieve the same structure by creating a project with the KMM Plugin project wizard or cloning the basic sample project.

Architecture

Kotlin Multiplatform Mobile is a flexible technology that allows you to share only what you want to share, from the core layer to UI layers.

This sample demonstrates sharing not only the data and domain layers of the app but also the application state:

Shared data and domain layers

There are two types of data sources. The network service is for getting RSS feed updates, while local storage is for caching the feed, which makes it possible to use the application offline. Ktor HTTP Client is used for making API requests. Kotlinx.serialization is used to serialize feed data and store it locally with MultiplaformSettings. This logic is organized in the shared module of the com.github.jetbrains.rssreader.core package.

Shared application state

The Redux pattern is used for managing the application state. The simplified Redux architecture is implemented in the shared module. The Store class dispatches the actions that can be produced either by a user or by some async work, and generates the new state. It stores the actual state and facilitates subscription to state updates via Kotlin's StateFlow. To provide additional information about state updates, the Store class also produces effects that, for example, can be used to display this information via alerts. This logic is organized in the shared KMM module of the com.github.jetbrains.rssreader.app package.

Native UI

The UI layer is fully native and implemented using SwiftUI for iOS, Jetpack Compose for Android, Compose Multiplatform for Desktop and React.js for web browser.

On the iOS side, the Store from the KMM library is wrapped into the ObservableObject and implements the state as a @Published wrapped property. This publishes changes whenever a dispatched action produces a new state after being reduced in the shared module. The store is injected as an Environment Object into the root view of the application, and is easily accessible from anywhere in the application. SwiftUI performs all aspects of diffing on the render pass when your state changes.

For subscribing to state updates, the simple wrapper is used. This wrapper allows you to provide a callback that will be called when each new value (the state in our case) is emitted.

Multiplatform features used

Platform-specific API usage. RSS feeds usually only support the XML format. The kotlinx.serialization library currently doesn't support parsing XML data, but there is no need to implement your own parser. Instead, platform libraries (XmlPullParser for Android and NSXMLParser for iOS) are used. The common FeedParser interface is declared in the commonMain source set. Platform implementations are placed in the corresponding iOSMain and AndroidMain source sets. They are injected into the RSSReader class (the KMM module entry point) via the create factory method, which is declared in the RSSReader class companion object.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].