kmm-production-sample
KaMPKit
Our great sponsors
kmm-production-sample | KaMPKit | |
---|---|---|
30 | 10 | |
1,917 | 2,068 | |
2.6% | 1.3% | |
6.1 | 5.2 | |
3 months ago | 3 months ago | |
Kotlin | Kotlin | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
kmm-production-sample
-
Kotlin Multiplatform for Android and iOS Apps
Business logic is not only about backend. Apps usually have a lot of client-side logic that can be written once in KMM and used on both platforms. See [1] for a high level architecture diagram.
I'm an iOS dev and I've been using KMM on a couple of projects for more than a year now. It's really a powerfull technology which allows teams to move faster, but there are downsides, for example lack of native Swift interop, though there are opensource tools trying to solve this [2].
[1]: https://github.com/Kotlin/kmm-production-sample/tree/master#...
-
Can't pick a Mac for cross platform mobile development. Which one should I go with?
I'm an Android dev for 10+ years and I've decided to give a go with Kotlin Mobile Multiplatform to try iOS development as well. For that purpose I would need a Mac obviously, and Windows 11's flaws don't help either so I made my mind and I would like to pick a Mac as my next developer machine for the next 4-5 years.
- Compose Multiplatform template
-
what is the best way to use flutter to get an iOS app from my kotlin code ?
I don't use iOS, but https://kotlinlang.org/lp/mobile/ claims that using Kotlin works on iOS too. You still will need a Mac though, but that's pretty much a given if you want to develop iOS apps.
- React or flutter? What is good for future
-
Getting Started Guide for Kotlin Multiplatform Mobile (KMM) with Flexible Sync
Kotlin Multiplatform with Realm as a middle layer.
-
Migrating our Largest Mobile App to React Native
Kotlin Multiplatform. You write the UI fully native for each platform, but have all the business logic as shared code.
-
Flutter for an Electronic Health Record and medical equipment app
maybe people confused it with kotlin multiplatform mobile which indeed support ios but only the business logic. you have to write the ui in swiftui.
-
Kotlin Server Side, but without a JVM
I think the most compeling use for Kotlin Native is mobile. I wonder if it's possible to write a Kotlin multi-platform library that can then be used from the JVM, JS, iOS and Android? What would such library look like from the other languages? This is something I am trying to find out right now, and Kotlin Multiplatform seems to be the only sane choice to do this (but I am not sure yet that it's actually good/possible right now). Any more information about this would be appreciated.
-
Backend Java 19 vs Kotlin?
Kotlin isn't just JVM and Kotlin projects like this one for writing iOS+Android apps look quite promising: https://kotlinlang.org/lp/mobile/
KaMPKit
-
Is Kotlin Multiplatform the right answer ?
In KaMP Kit we actually use Koin to add the Application instance: https://github.com/touchlab/KaMPKit/blob/main/app/src/main/kotlin/co/touchlab/kampkit/android/MainApp.kt
So yes I would recommend using KMP. If you already use kotlin then it's an easy transition, you just have to learn how all the pieces work together. If you're unsure about it start with a small module and import that into your android sample. You can also view some sample projects to get started like https://github.com/touchlab/KaMPKit and https://github.com/JetBrains/compose-multiplatform-template.
-
Kotlin Multiplatform Is Stable and Production-Ready
I've been using Kotlin Multiplatform Mobile (KMM) heavily for the past 2 years on my current startup. I'm currently in the process of removing the entire thing.
KMM is an alternative to a cross platform mobile library like Flutter, React Native, etc. The idea is that we could write all of our mobile app's business logic, networking layer, and caching layer in Kotlin, and KMM will codgen the matching iOS code. "We only need to write it once!" is the selling point. Then we get a blank canvas to build our UI using 100% native SwiftUI & Jetpack.
In reality, the codegened iOS code gets you 90% of the way there, the but extra 10% is extremely frustrating to work with. Enums (Sealed Classes in Kotlin) get mangled in translation and you lose exhaustive switch statements. Basic data types like Bool and Int get wrapped so you can only access them using additional .boolValue or Int64(..) constructors. Entire companies are being built around solving the pain point of this last 10%: https://touchlab.co
In my opinion, the fatal mistake the KMM team made was designing it to support Objective-C, instead of just Swift. So you're using a Kotlin layer -> mangled through Objective-C -> accessed from Swift. It's a confusing decision, as the only iOS teams still actively using Objective-C are legacy apps (like the Twitter app), which seems like the opposite target market for new mobile tech like KMM. Kotlin and Swift are both modern languages, and my gut says the interop between the two would be much better without Objective-C in the middle.
Further discussion from Droidcon if you're interested: https://www.droidcon.com/2022/08/01/sdk-design-and-publishin...
> As you progress beyond "POC" to integrating and shipping real production code, the design of the "SDK surface" becomes more complicated and nuanced (or, possibly, problematic)... An Android consumer can see all the richness of the Kotlin language, but the iOS side gets filtered through Objctive-C into Swift. Much can get lost along the way.
- interesting git repos
-
Add Kotlin/JS support to your KMM library
You may check out this commit where I made these changes for the KaMPKit project
-
Getting Started With Kotlin Multiplatform Mobile
KaMPKit This one is really good, and is kinda a best practice starting point. Touchlab is a very active contributor to the KMM community and it's definitely worth keeping an eye on their blog linked above.
-
Kotlin Multiplatform Careers
Lovingly gathered by Touchlab. Subscribe to the weekly digest here: http://digest.kotlinmultiplatform.careers
-
KoMPose Kit: KaMP Kit goes Jetpack Compose
Hey folks, Brady from Touchlab here. I've only been at Touchlab since the beginning of the year, but KaMP Kit, our simple-but-not-too-simple sample project to help those considering Kotlin Multiplatform, started way back at the end of 2019. Back then, Jetpack Compose had just been announced in May. It was a time full of optimism about the modern mobile UI development experience, but also of wild instability. The first method of getting Jetpack Compose to work on your machine involved pulling down the AndroidX development toolchain, and running a special version of Android Studio via terminal commands. Eventually, preview, alpha, and beta version of Compose could be used in the canary version of Android Studio (more history). Starting July 28, 2021, Compose went stable, and a version of Android Studio Arctic Fox, which supports Compose, was released in the stable channel shortly thereafter. Now we can use a stable version of Compose with a stable version of Android Studio. We at Touchlab have been excited about Compose for a long time; you can watch us geek out about it here. And though the community has been interested in Compose for KaMP Kit since at least May 2020, we didn't want folks who are trying out Kotlin Multiplatform with KaMP Kit to also have to learn a changing Jetpack Compose API, and require them to use a special version of Android Studio. Now that these obstacles have been removed, we feel comfortable fully endorsing Jetpack Compose in KMM.
-
Google and Facebook Login on Android with Coroutines
I recently started using Google One Tap and Facebook login for some auth work for one of our clients at Touchlab, and wanted to make sure I was using the recommended best practices using coroutines and the new Activity Result API. This was trickier than I realized, because the docs for Google One Tap are out of date, and the API for Facebook login is out of date. So after figuring it out, I wanted to share some code snippets for my future self, and I hope you get something useful from it as well.
-
Encrypted Key-Value Store in Kotlin Multiplatform
Multiplatform Settings is a solid multiplatform key-value store, created by Touchlab's own Russell Wolf, used extensively at Touchlab, as well as in Jetbrains' KMM Production Sample. There is a Settings interface that is implemented for Android, iOS, MacOS, and JVM platforms. At first glance, it doesn't look like Multiplatform Settings offers any encrypted storage. But thanks to the abstraction that Android has built into SharedPreferences and Multiplatform Settings' support for saving to the iOS keychain, our work is pretty easy.
What are some alternatives?
Newsletter-Kmm - Newsletter with Kotlin Multiplatform
ReKotlin - Unidirectional Data Flow in Kotlin - Port of https://github.com/ReSwift/ReSwift to Kotlin
multiplatform-settings - A Kotlin Multiplatform library for saving simple key-value data
leakcanary - A memory leak detection library for Android.
realm-kotlin - Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
TedImagePicker - TedImagePicker is simple/beautiful/smart image picker
facebook-android-sdk - Used to integrate Android apps with Facebook Platform.
Retrofit - A type-safe HTTP client for Android and the JVM
PeopleInSpace - Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, Compose for Web and Kotlin/JS + React clients along with Ktor backend.
gamedge - An Android application for browsing video games and checking the latest gaming news from around the world.
koru - Simple coroutine wrappers for Kotlin Native. Generated from annotations. Compatible with RxSwift, Combine, async-await.