Understanding The Basics of Kotlin Multiplatform Projects with Kotlin 1.3

With the recently announced Kotlin 1.3 comes a massive overhaul of Kotlin Multiplatform and a new DSL for creating projects capable of sharing code between different platforms, such as Kotlin for JVM, Kotlin for JavaScript and Kotlin/Native. In this article we’ll go through the key aspects of the new API and explain how you can use it to create projects capable of sharing code between Android and iOS.

The complete contents of this article are available on Xebia France’s Medium Space: Understanding The Basics of Kotlin Multiplatform Projects with Kotlin 1.3 and are referenced here for archiving purposes.

Kotlin Multiplatform: testing a shared module supporting iOS and Android

Conceiving your app as modular can be greatly beneficial to your codebase’s health. In particular, designing a separation between your view and business logic can decrease the coupling between your layers and improve maintainability as well as testability. Tests are indeed your app’s best friends, as they can, at the same time, verify the code you wrote works as intended and act as a specification for the implemented functionality.

Continue reading...

Sharing frameworks between iOS and Android with Kotlin Multiplatform

Today we’ll see how to use Kotlin code to write a cross platform module that can be shared between an iOS and an Android app. Since the support for building iOS frameworks, introduced with Kotlin/Native 0.5 in December 2017, it has been possible to use the same code for creating libraries for both Android (.aar) and iOS (.framework). A couple of months later, Kotlin/Native 0.6 officially supports this use case, thanks to the support of Multiplatform, a new functionality focused on sharing code across platforms, introduced in the version 1.2 of the Kotlin language.

Continue reading...