Nowadays on the internet one can stumble across the word 'cross-platform approach' more and more often, but what does that really mean? To give an answer to that we have to dive deep - and start from the classic approach to application development, namely to the development of a specific app for each platform.
Several development teams (each for each platform) make apps using native tools; they regularly organise meet-ups to make sure that the apps on different platforms are identical in design and functionality so that the user who changed the platform may continue using the app without experiencing any difficulties.
The result of that is interesting: several applications, created using different technologies and programming languages, look and function the same. At this point we have to go back to our question about cross-platform approach. This approach, compared to the classic native one, lets the developer use one codebase for different platforms, eliminating the support of different versions of one app. Different frameworks for the cross-platform development handle this problem differently: some compile the code to a native one for a specific platform, others use middlewares between a platform and a cross-platform code, but the principle stays the same: you write the code once and it is ready to be used on several platforms.
In this article I'd like to focus on mobile development, analyze the advantages and disadvantages of cross-platform approach and answer the question: 'Is it worth it to reject classic approach in favor of cross-platform one'?
As it was mentioned in the introduction, mobile apps can be separated into two categories: classic (we will call them 'native' later on) and cross-platform. I believe that before entering the world of cross-platform development of mobile apps we need to elaborate more on native apps.
In the sphere of mobile devices Android and iOS dominate the market. For the development of applications suitable for their systems, Apple and Google released relevant SDK. Android apps are developed with Java or Kotlin in Android Studio, iOS apps are developed with Swift in Xcode.
Those who are unfamiliar with the subject may find it weird to choose a native approach instead of a cross-platform one. Why would you write two apps, when you can write only one? After all, you can make your life a lot easier by writing a single app. But as usual in reality everything is more complex. Native development has a series of undeniable advantages, which I would like to discuss further.
First of all, it is the relevance. Native developers get their hands on all of the capabilities of a new version of an operating system, be it a small change of icons or a new full API for the improvement and advancement of their app. Cross-platform developers on the other hand have to wait until these capabilities are added to their used framework, or until someone in the community releases a library, which is often based on the native code.
Because of the specificities of internal workings of cross-platform frameworks, they slow applications one way or another, which makes native apps better in terms of performance. Also frameworks for cross-platform development of mobile apps, compared to native ones, do not have full access to the system API, making developers either write their own native code or look for a library which would solve their problem.
Overall the main disadvantage of a native app development is its cost. You should hire two development teams and provide communication between them. This disadvantage may be critical for small companies who do not possess high budgets and may lead to them choosing a cross-platform approach.
Now it is time to talk about cross-platform apps. Because of the large variety of available frameworks it is hard to pinpoint any general specificities, except for the cross-platform approach. However, all frameworks have similar pros and cons.
The main advantage of cross-platform approach is the solution of the main problem of native development - the need to have two teams of developers and support two codebases. That is the main idea of such frameworks and approaches in general - to make development faster and cheaper. If you choose this approach you will have to get only one team of developers, who will share the same codebase. All new features will be released at the same time on all platforms.
But solving this disadvantage brings up even more problems. The speed of cross-platform apps is usually lower than the speed of native apps. It will be particularly noticeable in the apps that use complex animation. As it was mentioned before, cross-platform apps have restricted access to an API of an operating system, which leads to the need to write a native code. However, it is worth pointing out that native code can be easily inserted into cross-platform code, but if you use this method too much it will lose its advantages. Another solution to this problem may be libraries created by other developers. It may help avoid splitting a codebase into cross-platform and native elements, but cannot prevent bugs and errors in the library itself.
However, if your app does not exploit all capabilities of the platform (smartphone camera, for example), by choosing cross-platform development you will be able not only to save money on the development cost, but to finish the development much faster, using the convenient tools for developers which we will discuss further.
There are a huge number of frameworks for developing cross-platform mobile apps, but the most widely implemented are React Native and Flutter, on which we are focused.
Although React Native has some specific problems with performance, it still is the most popular cross-platform framework with a large community. It supports a huge number of libraries, which makes development faster and facilitates the search for new developers. However, it seems that React Native competitor from Google will soon gain similar popularity.
Flutter is a relatively new framework (released in 2017), but despite its young age it earned a great reputation in developer communities. Flutter is constantly growing. At first being a framework for cross-platform mobile development, it has outgrown this definition. Right now it is possible to create mobile, web and desktop applications on the base of Flutter tools. Hot Reload, just as Fast Refresh in React Native, allows the user to immediately see any changes on the screen of the device, and a large collection of libraries makes it possible to forget about restricted access to a system API (however, you should be careful when choosing the library, as it may not support some platforms). Hot Reload also gives an opportunity to minimize writing a native code or completely abandon it.
Development in Flutter is performed using Dart programming language, which is also developed by Google. It allows adding new possibilities specifically for Flutter developers. Recently, the null safety function left its beta phase, which, when activated, requires developers to specifically point out variables, whose meanings may be null, and add check-ups for such cases, which results in higher stability of an app. Dart is also easy to learn for native developers, which gives them a possibility to quickly switch to cross-platform development as they wish.
A client part of a corporate CRM-system named DTIS was released in Doubletapp based on the Flutter developer tool kit. During the development we used all the benefits of Flutter and as a result launched the system as a web-version, a mobile app for iOS and Android and a desktop version for Mac OS, Windows and Linux.
Just at the click of a button company employees can request their salary or advance payment, look up the number of earned vacation days and request a vacation, use a sick day when they are ill to go to a doctor or buy medicine, send the request for compensation of additional expenses: for education, conferences, software purchase, purchase of the needed devices.
At the same time company management may pay salaries to their employees, accept their requests for vacation or additional expenses, easily add and browse revenue and expenditure and make transactions between company's bank accounts.
Flutter lets us launch our app with little effort in a short period of time on all the relevant platforms, giving an opportunity to employees and management to use the system on the platform of their choice.
Our app does not use many specific capabilities of each platform, that is how we avoided writing a native code for each available operating system. Minor problems arose with the access to the camera of mobile devices for QR-code scanning (so an employee can show that he took a device from an office to his home), but we quickly found a library which solved our problem. That is how we managed to save the single codebase for all platforms.
So should you reject the native development in favor of cross-platform development? The answer to this question depends on your app, budget and time which you are willing to spend on the development.
Native apps are still ahead of cross-platform apps in terms of functionality and performance, however, the development of such apps takes a lot of time and money. Cross-platform development, while still having some disadvantages, gives a possibility to create an app for several platforms in a short amount of time.
In conclusion, if your app does not rely on the specificities of particular platforms or if your development budget is limited, you should consider the cross-platform solution; otherwise, despite being able to solve the problem of inadequate access to the system API through the libraries, you should consider native development.
Discuss article on social media