Codementor Events

Why React Native is best for creating Hybrid app? (React Native vs Flutter vs Xamarin vs Ionic vs Cordova)

Published Sep 25, 2018
Why React Native is best for creating Hybrid app? (React Native vs Flutter vs Xamarin vs Ionic vs Cordova)

Here is why!

Nowadays, everyone is thinking to create the next Instagram, Facebook, twitter or Alibaba, but has no idea how to create or which language to use for creation. Earlier we had to create separate apps, one for each platform iOS, Android and Windows.

But then came the era of the hybrid apps, you can create apps for both android and iOS, using a single language or framework. Among many options in today’s market, which is best is a debatable topic. So I have written this article to help everyone choose which path to follow in their next mobile application development project.

The popular options to create the cross platform mobile applications, available nowadays are following:

  1. React Native.
  2. Ionic.
  3. Xamarin.
  4. Apache Cordova.
  5. Flutter.
    (Note: it is random order and note based on which is best)

Here is the comparison and a brief explanation of each platform for developing the Cross platform mobile applications:-

1.png
2.png
3.png

What is React native?

It is framework backed by Facebook for creating the Android and iOS mobile applications. Facebook has made it open source. Moto of the React Native is “Learn once, write everywhere”. It is dedicated to improve the efficiency of the developer and save time & money in development of the apps.
As apps build in react native is almost indistinguishable from the apps developed in the swift/objective C or Java. React native uses same fundamental UI blocks as native apps, in react native you put those blocks together by JavaScript, which is supported by both Android and iOS. With react native, you can render UI components for both android and iOS.

One of the best features of react native is that you can reuse the components on web and mobile platforms; that features saves lot of time when developing, web + mobile apps. It is popular among the JS developers.

Pros:

-Learn once write everywhere: Once you have learned the React, you can write the code for the web and mobile applications both. You can create apps in both Android and iOS. So you need to only learn one language and then you can use it in web development and mobile development.

-Rapid development: As same code is reusable at many places, development pace in the react native is very fast.

-Use of native components: React native uses the native components, so app made using react native gives the look and feel of the apps developed in the Android native and iOS native.

-High performance: React native gives excellent performance, tech giant Facebook has designed it in such a way that you cannot find difference in the apps created in native android/iOS and React native.

-Hot Reload: In the react native, one can use “Hot reloading” feature and see the changes made in the code, instantly. It is like a live preview. This feature makes is it very easy in the designing of the apps.

-Can be added in the existing naïve apps: If you have already made an app(s), not an issue, react native can be implemented in the existing apps also.

-Time & cost efficient: As you do not have to write the code for two separate apps, it saves so much time. As some components are ready made and available,in
react native development is likely to be 40% faster than the traditional way.

Due to which it is obvious that costing will be less, as we do not have to develop two sepaerate apps and also in future if you want to change anything, then you only need one react native developer and not Java and objective C/ Swift developers.

Cons:

-Native code is required: If you want, to make something very peculiar, for which no libraries is available then for that you need to write native code. For it you need some native coding knowledge but it is for some very rare custom features.

-Limited third party components: As React native is very young, not very vast options is still available, so this is sometimes hindrance, but if you have knowledge of native then you can make a bridge between them.

-Size is bigger: APK and IPA file’s size is bigger than the apps made in the native, minimum app size in the react native is 8 MB.

What is Ionic?

Ionic is an open source platform for creating cross platform mobile applications, it is based on the AngularJS. It offers optimized libraries of HTML, CSS and JS components, for interactive mobile app development.

Ionic is built on Cordova and AngularJS. Cross platform apps created in the Ionic are small web apps which are running on a browser shell in an app that has the access to the native platform layer.

This platform is most popular among the AngularJS developers for creating mobile applications.

Pros:

-Easy to learn: Ionic is easy to learn, as it is mostly HTML, CSS and JS, so any good web developer would be knowing it all well and hence can make a cross platform application, using Ionic.
-Rapid development: In Ionic, using the command lines, one can generate the pages, providers, services and many more things. All these things are produced by the template codes so development pace is very fast.

-It is built on AngularJS: Ionic is built on top of the AngularJS, so it is if you are already an AngularJS developer then working in the Ionic is very easy.

-Documentation is very easy: In the Ionic, documentation is very good, most of things are covered in their official site, and you don’t need to surf any other website for it.

-MV* pattern: ionic follows, the MV* pattern which is very useful in keeping the code structure well organized. It will be very helpful; especially if a new developer is added to an on-going project then it is easy for him/her to understand the logic, as everything is maintained well.

Cons:

-Performance lacks: Apps made in the Ionic does not give performance as required. For smaller apps, it is okay, but if app is medium to enterprise size then performance is not good.

-Not suitable for complex apps: It is not the most appropriate tool for building the complex or enterprise app, as it will lack the overall feel and result in not so good experience to the end users.

-May not be secure: If you are building an app for the bank, then Ionic is not the path you should go through for development, as apps built in the Ionic is more prone to hacking, compared to the native apps. I am not telling that apps built in Ionics does not have security but I would not suggest to develop such an app in the Ionic.

What is Xamarin?

Xamarin is C# based platform to create the cross platform mobile applications with the native user interface. It is mono based, which gives ability to .net and C# developers to develop the Android, iOS and Windows mobile applications.
It uses C# and the native libraries covered in the .net layer for cross platform app development so it is popular among the .net and C# developers.

Pros:

Use of C#: Xamarin, uses the C# for development, so any current C# developer, will be easily able to develop cross platform mobile application using the Xamarin. Developers can leverage the flexibility of the C# in mobile app development.
-Native user experience: Unlike other hybrid apps development platform that are web based, Xamarin can be said it is close to native apps and so experience of the end users on the app is close to the native one.

-Based on .net Framework: As it is based on the .net framework, any sound .net developer can make cross platform apps using the Xamarin, with some exposure to Xamarin.

-Performance close to native: Apps developed in the Xamarin delivers very good performance, which is quite similar to the apps developed in the Java and Swift.

-Easy code maintenance: In the Xamarin, the feature of interchangeability of the code in the cross platform, gives it the ability to maintain the code easily, especially whenever the need to update the logic is required.

-Complete hardware support: In the Xamarin, you get native level functionalities, it removes all sort of the hardware support issues with the help of the various plugins and specific API.

-Linking native libraries: It gives you the feature of linking with the native libraries, which gives it power to make more customization in the mobile application development.

Cons:

-App size: A simple hello world app in the Xamarin is of 16 MB; I think that’s a lot bigger for just a hello world app.

-It is not free for the enterprise app development: Xamarin is only free for small apps, no compiled code of more than 128K is allowed in the free version. So if you want to develop any enterprise level application then you need to purchase it.

-Limited third party libraries access: Xamarin does not have a very rich set of libraries. So if you need to develop something custom which is not available, then it would be a bit of pain.

What is Apache Cordova?

Apache Cordova also known as previously Phone Gap is a Platform to make the hybrid application, from simple HTML, CSS and JavaScript. It is a web view in which, all your HTML, CSS and JS is loaded for running the applications. Generally web applications are not able to access some of the core feature like accelerometer, GPS or Camera, but in Cordova you can.

With Cordova you can bundle the web applications into the mobile app(s) installer configuration:

-For Android: .apk (Android Application Package).
-For iOS: .ipa (iPhone Application Archive).
-For Windows: .xap (Silverlight Application Package).

Using above you can create mobile application in the Cordova, using just HTML, CSS and JavaScript. It was popular among the web developers, who can develop using only basic web technologies.

Pros:

-Just HTML, CSS and JS: As it is just the HTML, CSS and JS, any good web developer, who will know this can create cross platform app using the Cordova.

-Lots of plugins: Cordova uses, plugins to connect the JavaScript code to the native code. For almost anything you want to develop there is plugins available, so it is very helpful in development.

-Easier to create vector graphics: It is very simple and easy to make the UI of the app just like in the graphic design.

-Best for smaller apps: It is best suited for the small apps, in which not much native features are used. As it is made by plugins, small apps is built at very fast pace.

Cons:

-Poor performance: As Cordova acts as a container for the Web, performance of the app is not very good. If app is of medium to enterprise scale, then performance degrades and user experience is not the best.

-Browser compatibility: There are so many browsers, and to make an app compatible to all is a headache that will be difficult to handle.

What is Flutter?

Flutter is an open source mobile development application SDK, It is powered by the Google. It is developed in the dart language. We can use flutter for developing Android and iOS mobile applications.
It has a key feature of gesture recognition.

As React native, flutter is also avails you with the reactive style views; flutter to deliver the high performance has taken slight different path then React native, instead of JavaScript bridging, it uses dart (language created by Google). The peculiarity of the dart is that it is compiled “ahead of time” (AOT) into native code for the multiple platform. As JavaScript bridge is not required, it also improves the startup time of the app.

Pros:

-Hot reload: With the ability of hot reload, one can see the changes done in the code, instantly, this lets you test and experiment with the look of the app with more freedom.

-Reactive framework: As it is a reactive framework, you can easily update the interface, by changing the variable in the state; UI will reflect it.

-Pre-built widgets: As there are many pre build widgets, using them saves a lot of time in development.

-No JavaScript bridge: As it does not use JavaScript bridge, app gives very good performance and also the startup time is very fast.

-Gesture recognition: In the flutter, you can find many widgets for the gesture recognition, which will be very helpful to create a good user experience overall.

Cons:

-Beta version: Flutter is still in the beta version. From the feedback of the users they are still making changes and perfecting it for the full fledge release in the future.

-Insufficient libraries: As it is still new, flutter does not have very rich set of libraries, but it is growing at a good pace, so maybe in future we won’t have this issue.

-Lacks CI platforms support: As it is obvious, that it is new so it is not supported by many CI platforms like Jenkins or Travis. So automatic building, testing and deployment needs to run by custom scripts.

Conclusion:

Flutter is good, but it is still in the BETA version, Xamarin is also good but it is paid and not open source for enterprise level app, also the app size in Xamarin is very large compared to react native and other frameworks. Ionic is a good option but performance of medium to large scope app is degraded and results in bad user experience. Cordova has good resources, but performance is not good.

There are pros and cons of all the platforms, but looking at a bigger picture, I think React native is the one you should choose and especially, if you are going to launch a startup soon, then I personally suggest that you go for React native as It will save you a lot of money and time in development and give you apps for both Android and iOS which will give a high performance and experience to the end users.

On the basis of my experience and Research; I have come to a conclusion that React native is superior in terms, of UI, native experience, size and performance of the hybrid app development. It is best suited for your next Cross platform mobile application development.

Discover and read more posts from kishan
get started
post commentsBe the first to share your opinion
Raphael Alvarenga
5 years ago

First, thanks for sharing your knowledge. I’ve been studying React Native and I’m glad your conclusion is it’s the best option over all mentioned. But I wonder how I could reuse my React Native code to make a web app. Cordova, for example, is an option to reuse code in Android, iOS and web. I’d like to avoid headaches coding twice (mobile & browser)… would you have a suggestion?

Show more replies