Two serious contenders in the battle of mobile application development technologies.
First I should mention that maybe we could include React Native, Xamarin, Appcelerator, Fuse, Ionic, and some others since the cross-platform mobile application development battle is not only between them, but there are many other contenders, with advantages and disadvantages of course, but we are going to leave those other frameworks in the pipeline for now.
Flutter it came to version 1.0. Flutter is Google’s technology that allows us to build native applications for iOS and Android with a single base code, its stable version arrives in less than two years after being launched in May 2017, although they had already released the project since 2015 at the Dart Developer Summit.
Dart is a general-purpose language, similarly developed by Google and released in 2011, Dart is another object-oriented programming language somewhat similar to Java but it uses the Skia graphics engine.
Skia is an open-source graphic library sponsored and maintained by Google,… Is Google in everything?
The original Flutter team evaluated many programming languages and chose Dart because they fit the way they wanted to build the interfaces.
Dart allows Flutter to avoid the need for a separate declarative language layer like JSX or XML, or separate visual interface constructors because Dart’s declarative programming layout is easy to read and visualize. And with all the layout in one language and in one place, it’s easy for Flutter to provide advanced tools that make the layout a snap.
In NativeScript, if we do the development “vanilla” we will have an XML file where we make the layout, although it is much easier than doing it programmatically, we do not stop having this layer, if we make our NativeScript project based on Angular, we will have to adjust our components to give an HTML / XML output, that is, to adjust to the way Angular does things.
So NativeScript (and if ReactJS also hurry me):
- Has access to platform APIs and UI components
- They offer a level of abstraction for both platforms, as well as direct access to the native UIs.
- Provide some form of marking to build and style to the UIs (as mentioned).
NativeScript reached version 5.1, which speaks of a maturity since it has more time in the market.
Ahead of Time (AOT)
According to the official documentation, Flutter is built in a new way, completely different compared to other existing frameworks, it works more like a game engine than a traditional mobile application framework.
In Flutter, the applications are composed of Widgets, which are drawn on a Skia canvas (mentioned above) and sent to the platform. The platform displays the canvas and sends the events back when required.
Starting from the platform level, Flutter provides a shell (Shell) that hosts the Dart VM. The shell is platform-specific giving access to the APIs of the native platforms and hosting the relevant canvas of the platform that is being established. There is also an API that embeds, if we want to use Flutter as a library, instead of hosting a running app.
Compiling in native code also of course not only improves the execution but also the startup times of the application as Dart can also be compiled just in time (JIT) to achieve exceptionally fast development cycles and workflows that change the current way of working (including Flutter’s popular hot load sub-second stateful).
NativeScript works by exposing native APIs directly to JS, dispatching calls, and converting data on the fly.
In a little more detail, NativeScript technology can be presented as a multi-part construct — Runtimes, Core Modules, CLI, and Plugins, which is illustrated in the following diagram.
At the end of the day, who runs the best? What technology is more efficient in terms of performance? size? Is the difference significant enough to change technology? Well, I do not know, but we will do the corresponding tests to contrast the differences in applications made on both platforms. Please be patient.
If we go to a more general and perhaps strategic panorama, Google has an ace up its sleeve called Fucshia, the Google operating system that is said to eventually replace Android (in many years I think but that’s where it goes) development in Flutter will be natural or native.