From Kotlin to Native and back: accessing native macOS API in Compose Multiplatform

25 September 2025  ·  droidcon Berlin

Abstract:

Compose Multiplatform makes it easy to build cross-platform desktop apps with Kotlin and Compose, but what about native APIs, like iCloud on macOS? Accessing such APIs isn't possible through the regular Compose Multiplatform toolchain. However, with a bit of "magic", we can turn dreams (or feature requests) into reality.

In this talk, we'll explore how to combine Kotlin/Native and the JNI (Java Native Interface) to bridge the gap between a JVM-based UI and native system features. We'll write Kotlin code, compile it into a native library, and call it back from Kotlin.

You'll learn how to build Kotlin/Native code into a native macOS dynamic library and integrate it into a Compose Multiplatform desktop app, unlocking access to iCloud and enabling features like backup and restore for your app’s data.

Slides: