background
Years ago, when discussing what was the most popular solution for building mobile applications, there was always a comparison between native and cross-platform development, and the stereotypical “cross-platform apps are slow.” For cross-platform technology and application development, we should not only consider performance, but also evaluate development efficiency, company business scenarios and other aspects.
In general, cross-platform development has greatly improved the development efficiency, and the performance is acceptable after optimization. At present, mainstream cross-platform technologies can be divided into three categories: one is Hybrid technology that uses native built-in browser to load HTML5, mainly including Cordova, Ionic and wechat applets; The other is to use JavaScript development and then use Native components for rendering. React Native, Weex, and Fast Apps are the main uses of this solution. The last option is to use a native rendering engine and native components for cross-platform implementation, mainly with Flutter.
The performance comparison
Contrast indicators
At present, there are many kinds of application performance comparison, but the following data is essential, including:
-
Interface (API) : Interacts with the mobile application interface (accessing photos, file system, getting GPS location, etc.).
-
Business logic: Speed of mathematical calculations and memory operations, which is most important for applications with complex business logic.
-
Page rendering speed: animation smoothness, frames per second as the user interface changes, or some real-time user interface effect.
Compare the data
Here is a horizontal comparison of the performance of the Flutter, React Native and Native platforms by running the same application and then looking at the performance of different metrics, based on data from the network.
CPU Intensive testing of iOS Operating system (Gauss-Legendre Algorithm)
CPU Intensive Testing of iOS Operating System (Bolvin Algorithm)
CPU Intensive Testing of Android (Gauss-Legendre Algorithm)
CPU Intensive Testing of Android system (Bolvin Algorithm)
The above comparison data are obtained after 100 tests, the source code at github.com/nazarcybuls…
In comparison, native applications are still the best for mobile application development, but Flutter is also a good choice for development efficiency. The following is my forthcoming book on Flutter application development, tentatively titled Practical Application of Flutter Cross-platform. The book is listed below:
Application of Flutter pneumonia epidemic
2020 is bound to be a remarkable year. At the beginning of the New Year, the COVID-19 epidemic swept across the country. The constantly updated data of the COVID-19 epidemic made many people anxious, and the lockdown measures taken by many cities also brought a lot of inconvenience to their lives. Most offline businesses, particularly bricks-and-mortar stores, have closed overnight in the wake of the nationwide COVID-19 pandemic, with industries such as personnel intensive restaurants, tourism and cultural events among the hardest hit.
In the face of the epidemic, isolation is the most effective means of prevention and control, and has become an important variable to pull the business model reform. In the face of the severe epidemic situation, all kinds of activities such as visiting relatives and friends, business contacts and shopping have been put on hold even during the Spring Festival holiday. At the same time, governments at all levels actively responded to the disaster and epidemic prevention, conducted timely isolation and provided timely information on the development of the epidemic, thus gaining precious time for epidemic prevention.
The Spring Festival of 2020 is bleak and sad. The outbreak of the epidemic took us all by surprise. However, in this battle, the people of the whole country are united as one and we believe we will defeat the epidemic of pneumonia. Based on this reality, the pneumonia epidemic app is a tool-like app that provides the latest information on the development of the pneumonia epidemic and provides some protection measures. Here are some of the effects of COVID-19 applications.
Open source library
In the process of Flutter application development, the components and apis provided by the system cannot meet all development requirements. In order to complete development tasks quickly, some third-party open source libraries are needed in most cases. The following are some of the open source libraries used in this project, as shown below.
Cupertino_icons: ^0.1.2 // icon library dio: 3.0.9 // Network request library Fluro: 1.5.2 // Route navigation library provide: 1.0.2 // state management library webview_flutter: 0.3.19+8 //WebView library device_INFO: 0.4.1+5 // Device version information library pull_to_refresh: 1.5.8 // Drop down refresh flutter_swiper: 1.1.6 //Swiper cached_network_image: 2.0.0 // network image shared_preferences: 0.5.6+2 // Intl: 0.16.1 // internationalization open_file: 3.0.1 // File selection URl_launcher: 5.4.2 // Open third-party application connectivity: 0.4.8+1 // Network status monitoring photo_view: ^0.9.2 // Large image preview fluttertoast: ^3.1.3 //Toast message prompt SyncFusion_Flutter_Charts: ^18.1.0 // Chart component libraryCopy the code
To use, simply add these third-party open source libraries to the pubspec.yaml file.
In order to make it easier for developers to get started, it has been open source on Git. Welcome to Fork and Star. Download link: COVID-19 App.
1. Comparison of mobile cross-platform schemes: WEEX, React Native, Flutter and PWA 2, Introduction to Flutter and Environment building 3, Dart Language Basics of Flutter development 4, Flutter basics 5, Flutter development basics 6, Flutter Application debugging 7, Flutter For Web Introduction 8, Flutter development asynchronous programming 9, Flutter development Network request 10, Flutter development JSON parsing 11, Flutter development routing and Navigation 12, 14, Flutter application integration, Aurora push 15, Flutter hybrid development 16, Build our own Flutter hybrid development framework 17, Flutter application performance detection and optimization 18, 19, How can The Hot Reload of Flutter be implemented? 20, Why does Apple not ban Flutter? Will Apple ban Flutter in action