Paul Krill
Editor at Large

Kotlin mobile SDK shares code across Android, iOS

news
Sep 3, 20202 mins

The Kotlin Multiplatform Mobile plug-in allows developers to write, run, and debug shared code in Android Studio

recycle
Credit: Thinkstock

JetBrains has released an alpha version of Kotlin Multiplatform Mobile (KMM), an SDK that enables developers to use the same business logic in both Android and iOS mobile applications.

KMM draws on the mulitiplatform capabilities of Kotlin to streamline the end-to-end experience of building cross-platform mobile applications. The SDK is enabled by a preview of a KMM plug-in for the Android Studio IDE that allows developers to write, run, and debug shared code in the same IDE.

JetBrains said Android and iOS versions of an application can have a lot in common but also significant differences, particularly in the UI. Differences can range from subtle variations in scrolling behavior to divergent navigation logic. However, because application business logic including data management, analytics, and authentication can be identical, it’s natural to share some parts of an application across platforms while keeping other parts separate.

KMM offers flexibility while retaining native programming benefits. A single codebase can be used for business logic while platform-specific logic can be written when necessary, whether for a native UI or to work with platform-specific APIs.

Shared code written in Kotlin is compiled to JVM bytecode with Kotlin/JVM and to native binaries via Kotlin/Native. Thus, KMM business modules can be used like any other mobile library. With the plug-in, developers do not need to switch IDEs and have Apple’s Xcode running to ensure that code works properly on both platforms.

Companies already have saved time and effort sharing code between platforms, such as Quizlet and Fastwork, JetBrains said. The company has set up a KMM developer portal and published a guide on integrating KMM into existing projects.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author