brazilian software engineer with 25+ years of experience. I've spent 12 years in Android, 8 years in iOS (Objective-C & Swift), and the last 2 years exploring Kotlin Multiplatform. Passionate about crafting innovative mobile applications.
is a system that allows an application to be deployed with the use of the exact same application code. Is a system where a program for different platforms uses both of the codes specific to each platform together with a common code, shared by both the platforms. Multiplatform Cross-platform Like Flutter(Dart) and React Native(JS) , and MAUI(.NET)
and Kotlin/Native as it specifically focuses on mobile app development. Kotlin Multiplatform Mobile (KMP) is a technology (cross-compiled development framework) developed by JetBrains and uses Kotlin. KMP enables developers to write shared code that can be used across different platforms, such as Android and iOS, making it easier to create cross-platform mobile applications. “Kotlin Multiplatform Mobile” (KMM) is deprecated. JetBrains first introduced the Multiplatform feature in the Kotlin 1.2, released in 2017. The Kotlin/JVM compiler targets the Java Virtual Machine (JVM) and Android. The Kotlin/Native compiler targets the platforms macOS, iOS, tvOS, watchOS, Linux, Windows, and Android NDK.
the deprecation of the Kotlin Multiplatform Mobile (KMM) term. During his keynote at Droidcon Berlin 2023, Hadi Hariri announced an update that has now become the official guideline. From now on, the mobile development aspect of Kotlin Multiplatform will no longer be referred to as a separate product called "Kotlin Multiplatform Mobile (KMM)." Instead, we will use the unified term "Kotlin Multiplatform (KMP)." https://medium.com/tech-takeaways/kotlin-multiplatform-mobile-is-dead-long-live-kotlin-multiplatform-2b107227b2d0
to mean the Android & iOS specific parts of KMP, but JetBrains now says there’s no need to differentiate those front-ends from desktop, web and also back-end. It’s all called KMP from hereon!” —Someone Famous
developed by JetBrains and open-source contributors. You can choose the platforms across which to share your UIs using Compose Multiplatform: • iOS (Alpha) • Android (via Jetpack Compose) • Desktop (Windows, MacOS, Linux) • Web (Experimental) Compose Multiplatform (CMP) is a part of KMP that deals specifically with creating user interfaces (UIs) that can be shared between Android and iOS. KMP, on the other hand, is a broader framework for sharing business logic and data across platforms. Compose Multiplatform and KMM are often used together, but they serve different purposes.
their existing Kotlin skills and tools while leveraging the benefits of native development on each platform. Unlike cross platform solutions out there, KMP is plug and play, so there's not much work needed on the app side, just plug in the KMP code like any other library/SDK/framework. Performance Reuse skills Control your decisions You decide how much code you share across platforms. Since your apps are native, there's no performance or ux downsides. Plug and play
are pretty bullish on it, and creating lots of new libraries enhancing the ecosystem. Getting #Kotlin developers is an easier task than cross platforms out there. Especially when it comes to senior developers. Productivity Production ready JVM in Backend If your backend is in JVM, you can share the models (pojo / data classes), between your backend and frontend for a seamless development. Speeds up development by allowing teams to work on both platforms simultaneously. Developers
DRY (Don’t Repeat Yourself). But it’s important to understand what you can share. Kotlin’s philosophy is different from React Native. It aims to replace specific parts of the code, not everything. According to the website, it focuses on networking, data storage/validation, and business logic.
native library from any platform, as long as it’s available on the JVM. You can mix and match libraries from different platforms (e.g., Objective-C and Java) without overhead or cost. For example, an Android developer can use a powerful iOS SDK like ARKit without understanding new programming languages or frameworks. Kotlin also makes it possible to work with JavaScript libraries like ReactJS and NodeJS by running code through a JavaScript engine, such as Nashorn.
code and its platform-specific implementations for JVM, web, and native platforms. Once published, a multiplatform library can be used as a dependency in other cross-platform projects. You can build cross-platform mobile applications that share code between Android and iOS to implement networking, data storage and data validation, analytics, computations, and other application logic. Library App
develop the common parts of our libraries or modules. In Android’s case, generate an aar/jar file you can include in your project. If it applies to iOS, too, there is no need to worry about managing frameworks because they will be made available through Swift Package Manager or Cocoapods.
common logic that should be shared between the two target platforms. The androidApp module is a Kotlin module that builds into an Android application with Gradle as the build system. The iosApp module is instead an Xcode project building into an iOS application.
functionalities. They have to learn Kotlin to be able to use KMP. Platform-Specific Code Learning Curve iOS dev They have to learn iOS/Xcode to make sure the common code they produce works on iOS. Learning Curve Android dev
through unofficial plugins and build scripts. To develop, engineers need both Xcode and Android Studio open at the same time. - Apple does not show any willingness to support KMP officially. - Kotlin builds in Objective-C and doesn’t support Swift yet. Making it harder for the dev to debug. - Generics on Kotlin can not be inferred on iOS - Doesn’t support Codable, Default argument or Swift enums.
straightforward, (especially if the app is already using Kotlin) The good news is that your current codebase and KMP can cohabit. Migration can be done incrementally, one feature at a time using micro-libraries. It’s pretty easy to set up. Migrating an iOS app is more complex. The code in commonMain needs to be able to build for both iOS and Android, and it’s not true by default. • Migrate your Xcode build to the Gradle KMP build. • Move your iOS code to the KMP project. • Update all interfaces that use native inputs (like BigNum) with expect or the @optional annotation, to make sure the common code can compile for both Android and iOS. • Write custom iOS code in Kotlin for parts that can not be shared. • Rewrite some iOS code to use the KMP-generated library instead.
logic will be shared and written in Kotlin. • The iOS team will have less code to write. • Better testing of the business logic shared in KMP • Client PR reviews can be faster and knowledge shared between teams.
enforces one single immutable state. Information is passed from clients to KMM by emitting Events to a ViewModel. This ViewModel will have read only State and Effect flows that the clients can subscribe to for updates. https://github.com/apegroup/revolver