Should I learn PhoneGap or NativeScript?

Flutter: The fast newcomer in cross-platform app development

We are supposed to develop an app for iOS and Android. The question that often arises these days is: How? There are many different ways nowadays to develop these little digital helpers. Cordova, NativeScript, Xamarin, Ionic, Adobe PhoneGap, React Native, NativeScript, ... The list of possible technologies is almost endless and they all promise smooth development of cross-platform apps. Google also made this promise when in May 2017 "Flutter ”from them was officially released.

Many may now think that the release of a new cross-platform framework is nothing special. After all, there are already some technologies that make it possible to generate applications for iOS and Android from a single code base. Most cross-platform technologies such as Cordova, Ionic or Xamarin have, however, in contrast to "Flutter ”, one flaw: they don't create native mobile apps, just hybrid apps. But where is the difference here?

Native vs. hybrid

Native apps are specifically written for a specific platform with the programming language provided for this purpose - Android applications with Java or Kotlin and iOS apps with Swift or Objective-C. This has the advantage that the programming languages ​​that are best understood by the respective system and can best communicate with the hardware are used here. This gives you full access to the functionalities of the operating system. Since native applications have to be specially developed for the specific operating system, this means that one app has to be written twice. This of course also leads to twice the development time and twice the development costs.

In contrast to native mobile applications, hybrid apps only consist of a native framework in which apps based on web technologies are displayed. This has the disadvantage that the native component of the hybrid app has to communicate with the browser. The business logic is mostly written with Javascript, which cannot directly access the hardware and the functions of the operating system. Thus, these applications prove to be less efficient compared to native applications. However, the advantage here is that the app only has to be written once for both platforms, using technologies that are more widespread in the software world than the native programming languages. The best-known representatives for hybrid app development are Cordova, PhoneGap, Xamarin and Ionic.

But what does that have to do with Flutter?

Although Flutter is a cross-platform technology, the written code results in native apps that are compiled in the languages ​​optimized for the respective operating system. This brings the advantages of native as well as hybrid app development with it, which in turn is reflected in increased performance and faster development times. In contrast to most cross-platform technologies, Flutter Apps are not based on any web framework, but are written in the Dart programming language.

Why darts and what is it?

Dart is an AOT (Ahead-Of-Time) compiled programming language, which means that the code is converted into native machine code before the application is executed and independently of it. The precompiled program code is thus executed faster and directly on the end device.

The code written with Dart also has the advantage that it can also be compiled JIT (Just-In-Time). This means that the program code is used while the application is running. The ability to compile the code during runtime brings us to a powerful Flutter feature that software developers in particular should like: Flutter hot reload.

The hot reload function enables changes in the code during development to reach and be displayed on the device or simulator used for development within milliseconds.

The size of the changes in the code plays little to no role. The changes are immediately compiled in the running software and shown on the test device. This in turn increases the speed of development and promotes the fun and joy of development. Any native app developer will understand what I'm talking about. 😏

Darts also has the advantage that it has many similarities to other development languages ​​and can therefore be learned quickly and promptly. In addition, in contrast to native development, only one programming language has to be learned here, which in turn saves time, effort and costs in development.

The competition does not sleep (completely)

Flutter is not the only technology that gives us the advantages shown. React Native was developed by Facebook and, like Flutter, offers the possibility to create native cross-platform apps for iOS and Android.

Since React Native Apps are written in JavaScript, which is compiled at runtime - i.e. just-in-time - it requires a JavaScript bridge that must communicate with the native components. Flutter, on the other hand, does not need this bridge, which in turn means higher performance. Flutter is based on the C / C ++ 2D rendering engine Skia, which runs together with the program code, written in Dart, in a platform-specific shell. Each shell contains the interfaces to the respective operating system and communicates directly with it. With Skia, Flutter also has control over every pixel that is on the device's screen.

As the name suggests, React Native is based on the JavaScript framework “React”. Like every framework, React has its own peculiarities. As a React developer, you will find your way around this quickly. However, if you do not master this framework, you will need some time to familiarize yourself with it until you are ready to implement a React Native App. Anyone who is familiar with object-oriented programming languages ​​such as Java or C # will find it easier to learn darts and flutters. However, if you are more at home in web development with JavaScript / TypeScript and have already gained experience with React, you will be more likely to be convinced by React Native.

Although React Native was released 3 years before Flutter, the community behind the two technologies is similarly large. Flutter has seen a real hype over the past two years and has attracted the attention of many developers. The support of libraries also grew enormously in the last year and has a large number of usable connections. There is almost nothing for which there is no package for Flutter.

So why are we using flutter?

The reason why we prefer the development of mobile apps with Flutter is because, compared to the alternative platform solutions, it is the technology that delivers the fastest performance and offers the best development experience. With the extremely fast hot reload functionality, testing on a real device is finally fun again. Because only one code has to be written for both platforms, the development time and thus the costs are minimized. For us, Flutter results in an all-round stable and well thought-out overall package that delivers what it promises. So why not start the next project with Flutter in order to save time and costs and to achieve top performance on top of that?