Gå till innehåll

The Kotlin Multiplatform Mobile Series Part 1: Business Case Introduction

28 April, 2021

What is Kotlin Multiplatform Mobile?

Kotlin Multiplatform Mobile is a multiplatform technology to write code in Kotlin which can be used in platforms such as Android, iOS, tvOS, watchOS, macOS. It can also run in Linux and Windows, but to be better focussed in the article, we’d like to discuss the mobile OSes. That’s also the space we are actively building expertise in. It is to be noted that Kotlin is also used in server side programming. Kotlin is currently the language of choice for native Android development.

What is shared and what is not?

The business logic is shared and the UI elements are not. Consider a login screen: All business logic such as validating the email address, making the server call to authenticate, storing session information, processing and deciding which alert to show will all be coded in Kotlin Multiplatform Mobile. The UI elements such as logos, text boxes, login button, forgot password button will not be in Kotlin Multiplatform Mobile. 

 

Advantages

Reuse of code

This means multiple advantages as below

Flexible 

This is not a Kotlin Multiplatform Mobile exclusive feature, but it supports specific logic to be written for specific platforms. One operational advantage is that other multiple platform solutions have the logic written in JavaScript, so it can be challenging for the JavaScript developer to think in the mobile app development perspective and use the tools. With respect to Kotlin Multiplatform Mobile, it’s possible that it’s one of the mobile developers writing the common logic, so they will have the mobile app development perspective already when coding the platform-specific logic.

 

Huge damage control/very little wastage 

The current multiplatform solutions promise that they are not an “all or nothing” solution, but once a lot of resources are put into it, it makes it very hard to move away from them. Say, we start a project in React Native and it kicks off very well because it’s a simple MVP. As years go on, the project evolves and grows to such an extent that React Native is not a good fit. The most effective way to back out of it is to rewrite in Android and iOS again. But this may be at least 1.5 times the investment already made because we have to re-develop in 2 platforms. This is not the case with Kotlin Multiplatform Mobile, because what we have will be 100% usable for Android (Remember, Kotlin is currently the language of choice for native Android development?).The UI will have already been developed in iOS by this stage, so we will only have to rewrite the known logic in iOS. Instead of 1.5 times the investment hitherto, we would probably need just 0.25 times. Of course, every project is different, we are talking about the average case scenario based on our mobile development experience. If you’d like to gauge our expertise, please do check out our projects.

 

Test coverage and improved quality 

This is one place where even the most well maintained projects find it hard to dedicate time, but Kotlin Multiplatform Mobile nearly halves the time needed, because all business logic is in one place.

More integrated teams and more intra-team innovation

With Kotlin native, we have more integrated teams as both iOS and Android developers are in the same team. This gives them an excellent space to explore the other platform without having to forsake their previous experience, and team innovation is smoother because developers now get to develop and test their own ideas across all platforms.

 

Disadvantages

 

Kotlin Multiplatform Mobile and advances in iOS and Android

The last few years have been very exciting times for mobile development with SwiftUI and Compose making paradigm shifts in how applications are written. While Kotlin Multiplatform Mobile’s track history does give us confidence that they will support these changes, especially after they are stable, we have to note that they may not be fully compatible yet. But we have to understand that app development is not an all technical affair. There are other big aspects such as time to market, budgets, multiplatform support, feature consistency and feature parity across platforms. We generally take a decision with all these factors in consideration.

How much time is saved by using Kotlin multiplatform?

Every project is different, but most projects that aim for both Android and iOS should be able to save at least 25% of the project time(across both platforms), even by conservative estimates. While we won’t reduce the UI work, the main business logic will be shared. Also, the test case automation time will be reduced to 50%.

 

How is it used today and by whom?

These are some of the companies already on Kotlin Multiplatform Mobile:

Space by Jetbrains, VMware, Target, PlanGrid, CashApp, Careem, Quizlet, and SuperAwesome

Thanks for reading this article. If you liked it, please do share it and check out this space for upcoming parts of the series.

Tillbaka till nyheter

Se flera nyheter