When Google Play went live in 2008, creating a rival to the App Store, developers have been vexed by one simple challenge: how to build apps that worked across iOS and Android without duplicating all the work. While the world has witnessed the birth of gene editing, the Internet of Things and the Large Hadron Collider, we’ve struggled to solve this rather basic problem.

Now, however, a crop of cross-platform app development frameworks are promising to solve this particular Rubik’s Cube for us. Of this glitzy new breed, none is as popular than React Native, the framework rolled out by Facebook in 2015. Developers love its simplicity and versatility.

But, even if we find React Native extremely useful, we feel there’s an even better solution out there: Kotlin Multiplatform.

The Broader Picture

If someone tells you that apps are quick to build, they either know nothing about the subject or they’re being economical with the truth. Developing a basic app requires an average of between 200 and 300 hours. On top of that, you’ve got all the maintenance and upgrades: new features will be added to the app, and as more users use the app, more bugs may be spotted. Therefore, get ready to invest a considerable amount of development time in bug fixing and maintenance, including the annual OS updates required by iOS and Android.

For cross-platform apps, this has to be done twice over. All the key tasks have to be duplicated: developers have to write unique sets of code for both iOS and Android, then fix the bugs appearing across both platforms.

It’s clear that we can’t avoid having bugs nor spending time in feature implementations. Nevertheless, we can clearly save time if we are capable of just writing once our code base, and here is where React Native has been hailed as one of the best solutions to this problem, at least until today.

React Native has a bunch of great advantages. For instance, it is built using JavaScript, the language used to build web applications, which millions of web engineers are fluent at. Learning curve is easy, and there are plenty of resources available and third party libraries to help you develop your own apps.

Maybe one of the best outcomes of React Native is that it produces native user interfaces. What does native mean? It means that the visual interface that users will be interacting with is based on resources coming from the standard libraries of iOS and Android, instead of HTML web-based  visuals rendered inside a browser. This has a huge positive impact, not only on performance, but also on user experience. 

Indeed, React Native seems a great option when it comes to coding an app for both iOS and Android platforms. However, it has a couple of significant drawbacks, and here is where we see Kotlin Multiplatform shine.

The React Native Reality

React Native promises three things:

  1. The same code for both platforms
  2. A JavaScript defined user interface
  3. A library with plenty of tools to boost your app development

However, the reality is slightly different. 

First, it’s true that you will write a single code base for both apps. However, the code will fastly start having conditionals depending if the target app is iOS or Android. This is a typical behavior in React Native apps, which defeats the original purpose of one shared code to rule them all (app platforms).

Second, being able to write native user interfaces (both iOS and Android) in JavaScript is definitely awesome. However, you’re tied to the React Native middleman. You can do whatever React Native allows you to do (which is a lot, but still limited). If you want to build something outside the React Native standards, you will have to code it natively plus add a bridge to React Native. Not a trivial thing. And no matter if iOS or Android releases new versions of their OS, your apps won’t be able to benefit from the latest resources until a newer version of React Native is available and supports it.

Finally, as you are writing JavaScript code under the React Native umbrella, you’re limited to the resources that the React Native framework provides you, as well as whatever the React Native community produces. Many of your application feature needs might be already fulfilled with these options, but the world is actually way bigger than React Native brings you, and you are somehow missing all the options coming from the whole Android and iOS community.

Is this necessarily bad? Maybe. It depends on the needs of your app, project or company. For fast prototyping and product validation React Native works awesomely. For established companies and products that expect their apps to have a long life cycle, this is not clear anymore, as you might want to have more flexibility and remove dependencies that tight your whole application to.

The Emerging Alternative: Kotlin Multiplatform

Kotlin Multiplatform is still fairly new technology,  but it’s being backed by one of the most important development companies nowadays, JetBrains (responsible for the most popular Integrated Development Environment applications). The community is eagerly waiting for upcoming releases, and more and more developers are starting to use it.

Then, what is Kotlin Multiplatform and how can it help me?

With Kotlin Multiplatform developers can produce a library that runs natively in both iOS and Android platforms. This huge step forward in the iOS vs Android crossover battle. Until now, running natively code in both platforms required complex C++ libraries and a high level of coding sophistication, which wasn’t always a good idea to invest in for simple apps. However, this changes with Kotlin Multiplatform. Now, anyone with a basic knowledge of Kotlin (the language used to build Android apps) can write a piece of code that runs in Android and iOS. This is a breakthrough.

For instance, now we can design apps in a way where we focus all feature logic in a module written in Kotlin Multiplatform. By doing this, we can reuse this module in both iOS and Android. This way, as all users will be using the same logic module in both platforms, bugs will appear faster and solved once, maintenance is going to be simpler and adding features will require to support only one base code.

We have just saved 50% of the amount of code initially required to code both apps, plus more than 50% of the time for future maintenance as QA happens at double speed.

Therefore, just like React Native, we can create a single set of business logic which will adapt automatically to both iOS and Android. But unlike React Native, Kotlin Multiplatform forces us to build a native user interface (UI) for the both platforms using their specific standard libraries. This might seem a drawback but it’s actually great: by being able to code UI natively, we can produce a high end quality interface without any intermediate library. We are coding pure iOS or Android code and we can customize it as much as we want.

Mobile Jazz Bets In Kotlin Multiplatform

The benefits are clear. Thanks to Kotlin Multiplatform developers can now write fully native apps, with all its high performance and customizations, while still saving time on development and maintenance thanks to its code sharing capabilities.

While React Native is a great choice for product validation and low-budget projects, Kotlin Multiplatform doesn’t couple your apps to a specific base framework as React Native does, allowing a greater level of flexibility and scalability over time. This is great for established companies and products that have already validated and now are looking for a long life span cycle.

In the last 2 years, Mobile Jazz has been investing hundreds of hours in Kotlin Multiplatform team training, as well as developing a fully customized software architecture methodology to help our customer’s projects achieve their goals faster, cheaper and without sacrificing scalability nor flexibility. Many of our current projects are being developed using Kotlin Multiplatform, and our clients’ happiness speaks for themselves.

Joan Martin

Starting with a mathematics degree, continuing with a computer science master's degree, and working on mobile and backend development during the past 10 years, Joan is a proficient software engineer. Motivated by great projects and an awesome team, Joan is currently leading the Mobile Jazz team and enjoying the MJ philosophy at its best.