Still, Going Native Is Better Than React Native and Flutter
Having a single codebase is a great thing. But there are hidden side effects.
Many developers created mobile applications with these kinds of webview-based frameworks. However, everybody realized that native GUI elements are in the heart of a user-friendly mobile application. The uprising of React Native and Flutter has happened. Both frameworks gave the freedom to go with a single codebase like Ionic by having truly native GUI elements. Let’s look at these two trending projects.
Flutter created their own widgets framework for a cross-platform 2D graphics library called Skia. On the other hand, Skia can run on both Android and iOS platforms. Therefore, whatever you build using the Flutter widgets framework will work on Android and iOs. Besides, they created Dart libraries for native features. For example, if you want to make your phone vibrate, you can use the vibration Dart library. These Dart libraries usually call native code directly to do the required functions. For example, the vibration library uses
android.os.Vibrator class in the Android platform.
The great thing about Flutter is that it allows you to create the same look and feel for your app on any platform. Your application will look exactly similar on Android, iOs, Linux, Windows, macOS, and Web. We can clearly see that Google created Flutter to solve their cross-platform development problem. They wanted an easy way to make apps for Android, iOs, and, Fuchsia with the same look and feel.
Facebook used their own web library (React) to solve the cross-platform problem. React library uses DOM as the rendering backend. They created React Native by switching the backend from DOM to native mobile. In other words, components made with React Native will render as truly native GUI elements on each platform. Solving the layout problem could be challenging if we need to have native system GUI elements. In other words, the layout system is different in Android and iOS. Therefore, React Native introduced the Yoga cross-platform layout engine for both mobile platforms.
Hidden issues in Flutter
If you are planning to have the same look and feel across many platforms, Flutter is a wise choice. But there are some disadvantages as well.
- Flutter uses Dart instead of Java and Objective C/Swift. Therefore, there are Dart libraries for native operations. Some libraries are official, and some are third-party libraries. External libraries can have limitations and bugs. No wonder if your software tester reported an issue that belongs to one of your dependency libraries.
- Flutter uses their own widgets toolkit on their own 2D graphics library. I saw there are a lot of bugs reported about animations on Android/iOS.
Hidden issues in React Native
If your application has more native dynamic content, React Native is a wise choice. But there are some disadvantages as well.
- React Native’s learning path could be a bit challenging for developers who are new to React. On the other hand, Flutter offers a simple object-tree-based layout concept which is a lot easier than the native way.
Frameworks vs. the native approach
Native API offers a very flexible and up-to-date way to build mobile applications. But, frameworks provide a generic abstraction layer for multiple mobile platforms. If Android/iOs SDK introduced a new API, you need to wait until someone creates a cross-platform library for it. Otherwise, you have to write a cross-platform library yourselves. Therefore, if you are planning to build an application that consumes a lot of core APIs, the native way is the safe and reliable method.
Further, if you are directly using the native API, there is no need to worry about the issues coming from wrapper libraries. In frameworks, if you found a bug in a wrapper library, usually you have to wait until someone applies a fix for it. Each framework solved the cross-platform problem by creating several side effects. But if you are going native, there are no such side effects.
Still, native is the winner if we compare the technical side and user experience. However, the development cost and rapid feature delivery are important factors of modern mobile application development. Therefore, we can choose a cross-platform mobile framework by considering all aspects that may affect the mobile app’s quality and our business. If we need an optimal way that is better than going native, there are two:
- Each platform can offer a generic interface for its native API.
- Implement a framework that will transpile everything to the native code.
The above events haven’t happened yet. Therefore, still, going native is better than cross-platform frameworks.