All Ruby on Rails Node JS Android iOS React Native Frontend Flutter

React Native vs Kotlin Multiplatform. How the Future of Multiplatform Development Will Look Like?

Over the past few years, React Native has become a popular choice for the Android and iOS apps development. The cross-platform code sharing promise is undoubtedly the most tempting feature of this technology. Despite being a very popular choice React Native is not a holy grail and has its own limitations. There are companies which already decided to change their mobile tech stack radically and switch to platform-native development of their existing apps.

There is however a new solution available which aims to allow implementing scalable, multiplatform projects which promise to eliminate the React Native issues. Kotlin Multiplatform allows targeting not only iOS and Android but also backend, web frontend, and desktop platforms at the same time allowing to compile the shared codebase into platform-specific executable code without any bridge.

This article will compare and contrast the capabilities of the well-adopted and already mature React Native technology with the new experimental Kotlin language feature called Kotlin Multiplatform in order to find out what use cases each of them better suits for.

React Native

Being already stable for a few years now React Native - a framework created by Facebook, is a popular choice for mobile apps development. It allows building mobile apps for Android and iOS in JavaScript. React Native let us compose UI components in JS code which are then translated into the native platform-specific components.

The big advantage of React Native is the big community and good adoption in the mobile community. There are plenty of external libraries and custom, open source components available around. All this makes it convenient choice for rapid prototyping and quick MVPs.

What’s the main drawback of this JavaScript-powered framework? Probably the JavaScript itself which limitations make React Native projects somewhat harder to scale and less flexible compared other technologies.

Main features

  • UI code shared between iOS and Android

  • Powered by JavaScript

  • Live reload of the app's UI

Pros

  • A great number of open source libraries

  • Big community

  • Reusable UI code

  • Short team size

  • Good for small mobile MVP projects

Cons

  • Low security and memory management issues due to JavaScript based libraries

  • Bridged communication between JS code and native platform

  • Performance issues

  • Limited to iOS and Android platforms

Kotlin Multiplatform

Since Kotlin started to be officially supported by Google as a language for Android apps it is constantly growing. Kotlin is becoming very popular among developers because of its cleanness and development speed. It was even chosen as the second most loved programming language in the Stack Overflow Developer Survey in 2018. Although this new language itself is currently most popular among Android developers it can be used also on the backend and frontend sides. Moreover, it can be compiled and run natively on iOS, MacOS, Linux, Windows, WebAssembly, and even embedded systems like STM32.

Starting with Kotlin 1.2 JetBrains released an experimental language feature called Kotlin Multiplatform. Its promise is to write the business logic components once and reuse on all platforms it can be compiled to including JVM, Android, JavaScript, iOS, Linux, Windows, Mac and embedded systems. The biggest advantage over other multiplatform solutions like React Native is that Kotlin code can seamlessly cooperate with other native components like UI layer or platform-specific code. Moreover it’s possible to share the logic with a backend or whatever other applications you might have.

Main features

  • Multiplatform development of business logic code

  • A great number of compilation targets - Android, JVM, native: iOS, Windows, Linux, embedded platforms and more

  • Modern language - safe, concise syntax, efficient multiplatform async framework and more

Pros

  • Compilation to native platform-specific executable artefacts

  • No bridges between shared code and native platforms

  • Best possible performance

  • Possibility share code on many platforms: Android, JVM, JS, native (iOS, x86, stm32 and more)

  • Suitable for top-crafted, scalable projects, not only for mobile apps

Cons

  • Still in the experimental state

  • A limited amount of available libraries

  • Usually requires a bigger team of devs working together

  • Less suitable for fast MVPs and prototypes


What the future will look like?

React Native tends to lose its domination in the mobile area which is probably caused by the latest release of Flutter - another multiplatform UI framework by Google. The future of both is still unknown, although it seems the hype for Flutter has already started.

Is there a place for Kotlin Multiplatform then?

It seems so. It turns out it could be a great technology to be integrated into the mobile apps along with Flutter. That’s because Flutter allows separating the UI layer from the business logic effectively and Kotlin Multiplatform provides an exceptionally good way of the business logic code sharing among multiple platforms.

There is also an experimental Google project under development - the Hummingbird. It aims to allow reuse of Flutter UI code not only on mobile platforms but also on the web frontend. And that’s the web frontend where Kotlin Multiplatform has the potential to be used as well. The Flutter for Web beta is speculated to be announced around Google I/O 2019.

Are we going to develop multiplatform apps for the mobile and web platforms at the same time? it seems there is going to be such an option available. Developing apps with Kotlin Multiplatform and Flutter would require the use of two languages - Kotlin and Dart, however, from the developer perspective both languages are friendly. Although there are already the basic Kotlin Multiplatform libraries available like SQLDelight database, Ktor REST API client or Kissme - secure key-value storage, the Kotlin Multiplatform adoption will highly depend on the development of the new ones.

Is it the end of React Native? Probably not. As a mature technology, it will still be great choice for iOS and Android apps - especially for rapid MVP development and fast prototyping. However, it seems it is going to be an interesting year and the new multiplatform development standard is just around the corner. Stay tuned and let’s see what this year comes with!

digital transformation
Code stories CTA
READ ALSO FROM Mobile
Read also
Need a successful project?
Estimate project or contact us