The Future with Kotlin Multiplatform

Emmanuel Iyke
4 min readNov 30, 2020

--

Before we begin, I would like to point out that this is my first article ever, so if you find any mistake in it, leave a comment and I will get right at that. with that being said lets begin.

What is Kotlin MultiPlatform :
I have a lot of Developer friends who are a bit reluctant to start utilizing the power of Kotlin multiplatform maybe because they are yet to understand how it works or that they don’t really understand the flow. In this article I am here to tell you all about Koltin Multiplatform and How you should start Utilizing it as a developer.

Kotlin MultiPlatform Explained :
Kotlin MultiPlatform is an external feature in Kotlin that lets you share business logic between platforms, that is, it lets you write kotlin in between javascript, ios and native desktop applications. Kotlin MMP lets you share code between all the targeted languages reducing the amount of time required for development.

TARGETS WITH KOTLIN MULTIPLATFORM

Kotlin Android: this is a platform most developers know and use, this version of koltin targets 80% of Android app versions from Android 4.1(jelly_bean) to 9.0 pie. With this version of kotlin, Android developers can develop and deploy Android applications to suit 90% of the Android app version.

Kotlin JVM: this version of Kotlin makes Kotlin integratable with any or if not all versions of Java virtual machine(JVM). This means that in all versions kotlin can be used in any platform that has java running on it.

Kotlin Native: this makes Kotlin language support different platforms such as:
iOS (arm32, arm64, simulator x86_64)
macOS (x86_64)
watchOS (arm32, arm64, x86)
tvOS (arm64, x86_64)
Android (arm32, arm64, x86, x86_64)
Windows (mingw x86_64, x86)
Linux (x86_64, arm32, arm64, MIPS, MIPS little endian)
WebAssembly (wasm32).

Kotlin/JS: this provides the ability to transpile your Kotlin code, the Kotlin standard library, and any compatible dependencies to JavaScript.

Why you should consider using Kotlin

For Android developers: Apart from kotlin being the official language for Android development this are some reasons why Android developers Should seriously consider Kotlin over java

  • It makes Android development much easier
  • Well known companies are already using it in production
  • It’s more safer than java
  • Kotlin is Multiplatform
  • It Comes With a Smarter and Safer Compiler
  • It’s easier to maintain

For non Android developers : the following are reasons why you should consider Kotlin with js :

  • Familiarity: If you’re coming from a compiled language like Java, Swift or C#, you’ll find Kotlin very easy to learn — and you might already be familiar with it if you’re an Android developer.
  • Friendly tools: IDEs can’t help you much with JavaScript, while Kotlin comes with first-class IDE support so that you can spot common errors as you type the code.
  • Sharing code between platforms: With Kotlin MultiPlatform Projects, you can write the business logic of your app once, and share it across many platforms including your back-end, browser front-end, Android and iOS clients.
  • Interoperability: The ability to call JavaScript code from your Kotlin code is very important. It lets you reuse existing JavaScript code you’ve already written with Kotlin. This interop works in the opposite direction as well. You can call your Kotlin code from JavaScript.
  • JavaScript woes: Kotlin is a perfect choice if you gave up on web development because of common JavaScript issues, such as having to deal with dynamic typing, weird logical comparisons, or prototypes.
  • You can check it out here.
  • Problems usually associated with Kotlin Multiplatform

Kotlin MultiPlatform is new : Apart from Kotlin being released 4 month after flutter, Kotlin multiPlatform went alpha lately 2020, that means that its community is low, it has less documentation and most devs Haven’t even known of its existence. Koltin being powered by JetBrain and Google, it has a very high promises and expectation

Flutter is Usually compared to Kotlin : Flutter is usually compared to kotlin when it comes to efficiency, tool Friendly, Easy to use, High Customization, Reload performance etc, but what is often tend to be forgotten when it comes to cross platform is that flutter is a framework while kotlin is a programming language, so that means that the both platform should have their strengths and weakness.

UI Integration : One of the disadvantages of KMM(Kotlin Multiple Mobile) is having to use platform specific UI for their Integration, which is often time consuming. I Think that there will be a shared ui in the future but for now, it uses platform specific ui

Conclusion: regardless of Kotlin MultiPlatform being new, it has a lot of promises when it comes to cross platform Integration, Firstly because it’s being powered by Jetbrain, a Company who are amazing for their programming language, and Also the Android community for supporting KMM is strong and active. KMM for now is best used to integrate apps which are already running their own android app on the app store.

--

--