News

Native vs Cross-platform development

If you want to create a mobile application, then you have two options: native development, when the code is written separately for the iOS and Android platforms in different languages, and cross-platform, when the code is written once and runs on all platforms. Moreover, while native development has a more or less established set of tools, new players are still appearing on the market for cross-platform solutions.


Today we will talk about just one of them - Flutter. This is a young, dynamically developing framework; its official release took place in December 2018. Many people ask the question: is it worth developing applications on it? Is it better or worse than existing solutions? Is it worth getting involved with cross-platform technologies, or should you give preference to native development? In this article we will try to answer these questions in order.
Do I need cross-platform development?
Why is it worth choosing cross-platform solutions? Let's start with the fact that they allow you to save budget and project time by reducing working hours, since work on two platforms is carried out simultaneously and using the same technology. Once written and debugged, the code potentially contains far fewer errors and discrepancies in its operation than if the application was developed separately for each platform by different teams. Product support (adding functionality to an application, fixing bugs on both platforms at once, releasing an updated version to two stores at once) will be cheaper for the same reasons.

We also recommend choosing a cross-platform application in the following situations:

When you need your application to look the same on different platforms. Navigation between screens, the search field, and the system calendar look different on iOS and Android, but cross-platform solutions allow you to take the best of both operating systems and implement a single design option.
When the application being developed does not require the use of all the computing resources of the device for its operation. In general, cross-platform technologies allow you to implement almost any type of application, but there are exceptions. For example, games or applications with augmented reality that heavily load the processor and RAM (in other words, “performance intensive”).
When the application is focused on "card material design", which is quite popular today. What is a trivial task on Android becomes a real headache for iOS developers. They spend significantly more time developing the interface. With cross-platform technologies (in particular, Flutter), developers “out of the box” (that is, they do not need to additionally install libraries or configure anything) have access to all native UI components of both platforms, which makes work much faster.
Why Flutter is better
However, there are quite a lot of cross-platform solutions these days. Why is it worth paying attention to Flutter?

In the article on the Typical Programmer website you can see an overview of the most popular tools for writing cross-platform applications today. Please note that if you want the application speed to be as close to native as possible, then you have only two options - React Native and Flutter. These technologies are now the most advanced in many respects. Why should you choose Flutter, despite the fact that there is React Native, which is somewhat older, has already proven itself and has a fairly large developer community?

Flutter is closest in performance to native applications. As a rule, other web-based solutions always have a JavaScript layer that converts JavaScript code into native calls, and React Native is no exception. Flutter, on the other hand, does not use JavaScript and does not require intermediate code transformations at all. It is based on the Dart language, which compiles directly into native code, and uses the Skia graphics engine, written in C++, to render the visual part of the application. Therefore, its productivity is significantly higher.

Flutter основывается на языке Dart
The interface elements that Flutter draws do not depend on the version of the operating system (OS) on which the application is running. In contrast to the same React Native, which always refers specifically to the native components used by the OS. Therefore, the appearance of the application may differ slightly on different OS versions. For Flutter there is no such problem - the application will display and function correctly on both old and new devices. By the way, about new devices. Not long ago, developers were faced with the fact that not all applications adequately supported the dark theme in iOS-13 when it first appeared. Due to the fact that Flutter does not use system interface components, it was not affected by this problem.

Flutter is much less dependent on third-party libraries needed to write the application interface. Let's say React Native accesses native OS components via API and relies on special plugins. Such components may not be updated in time and “break” the appearance of the application. Whereas Flutter already has built-in libraries for both platforms with a fairly rich selection of UI components that give the developer complete freedom of action. The risk of suddenly getting a “broken” interface is much lower here.

Those interested in a more detailed analysis from the point of view of mobile developers can read the article from the company's blog The Droids On Roids. The article is interesting because the authors have experience in both native and cross-platform development, therefore they evaluate frameworks from different angles.

Disadvantages of Flutter
No matter how good Flutter is, it is still not without its shortcomings. It has already been said that this is a fairly young technology, and if your application requires the use of some specific native libraries, then their Flutter counterparts may either be absent or be too raw and unstable. Yes, it is possible to write native code (code in a language that native developers usually write in) and call it from Flutter. But another problem arises: if there are too many calls to the native code, this will still affect the performance of the Flutter application. In this case, it is better to immediately turn to native development.

Perhaps future users of your application are too accustomed to the standard UI/UX? Then it will be difficult for them to use the single interface of the two platforms. A striking example is the “Back” button in navigation between screens. While Android provides a hardware Back button for this, iOS uses either a button on the left side of the navigation bar or a finger swipe from the left side of the screen. Without this button, iOS users will not be able to return to the previous screen, and with the button it will be unusual for Android users. Cross-platform is always a design compromise.

On average, Flutter applications are approximately 20% larger than their native counterparts. This is because they contain their own widgets and renderer and do not access system components. However, Google is also working on this, optimizing the size of the final app builds.

Development prospects
Since its official release, Flutter has gained a lot of supporters, and its developer community is growing very, very quickly. Its popularity is evidenced by the following statistics of questions on StackOverflow:


Статистика популярности flutter

Judging by the graph (as of 01/31/2020), Flutter in the year since its official release has achieved the same level of popularity that React Native achieved in 3 years. Moreover, interest in Flutter only continues to grow, which means that the technology is truly in demand and is successfully taking root among developers.

And here are the statistics of Google queries around the world over the past 5 years (data as of 02/03/2020):

Статистика запросов flutter в Google за 5 лет
The Ionic and Electron frameworks were specifically removed from the statistics, since these names coincide with terms from physics, and it will not be possible to differentiate between requests. As you can see, the popularity of Flutter in queries in the Google search engine is also growing steadily every month, and it is slowly but surely overtaking React Native, its main rival. Which also suggests that Flutter has prospects, and quite good ones.

Cross-platform development - to be
Flutter already has a lot to offer the developer community. It may be too early to call it the absolute champion among cross-platform solutions, but its future seems quite promising. Google has already said that they intend to actively develop their product, since they themselves use it in their projects. So we are waiting for the shortcomings associated with cross-platform to be finally eliminated, and for Flutter applications to become more in demand.
Made on
Tilda