Skip to content

Mulitplatform overview and motivation

Ruby Lichtenshtein edited this page Nov 7, 2018 · 1 revision

The main selling point for cross platform frameworks is that you’ll be able to share a code base between platforms. The amount of shared code depends on the framework of your choosing.

  • WebView based

Frameworks like PhoneGap, Apache Cordova, Ionic, etc. are all based on WebViews. That allows developers to create mobile applications using web technology such as HTML, CSS, and JavaScript.

The biggest issue with these frameworks is performance. Even though WebView’s improved over the years (iOS WKWebView and Android Crosswalk), it won’t match the performance of native widgets.

  • Native Widget based

Using React Native, the developers can use JavaScript and JSX (JavaScript syntax extension) to construct their application from components that are then mapped to the platform specific widgets.

The biggest issue this time is that, in order to use native widgets, the JavaScript part of the application has to communicate with the native part through a “bridge”. This is most noticeable when dealing with animations. Luckily AnimatedJS was created to handle most cases — but not all. In order to create a performant React Native application, we must keep passes over the bridge to a minimum.

  • Custom Widget based

Flutter does not use WebView nor does it use native widgets. Rather, Flutter communicates directly with the canvas and renders the whole UI in a very effective way. Flutter provides a rich set of widgets that are easy to use, compose, and customize.

Flutter is using channels for communicating with native apis and still have the "bridge overhead"

  • Platform Compiled based

Kotlin mulitplatform allows you to use native api with expect/actual machnizem. Your Kotlin code compile to platform native code

https://medium.com/inloopx/native-or-cross-platform-mobile-app-f113aa7ab581

  • Multiplatform motivation

  • Kotlin targets

    • KotlinJS

      • Client-side JS
      • Server-side JS
      • KotlinJS Interop.
      • Testing.
    • Kotlin Native

      • Why Kotlin/Native?
      • Target Platforms
      • Testing.
  • Kotlin Multiplatform

    • Platform-Specific Declarations - expected/actual mechanism
    • Common module.
    • Architecture.
    • Testing.
Clone this wiki locally