Xamarin vs. React Native

7 min read 2159

Xamarin vs. React Native

Editor’s note: This Xamarin vs. React Native comparison was last updated on 25 February 2021.

In this guide, we’ll zoom in on two popular cross-platform development frameworks: Xamarin and React Native. We’ll evaluate each according to criteria such as performance, popularity, and community support and describe the pros and cons associated with using both Xamarin and React Native.

Here’s what we’ll cover:

What is cross-platform development?

Cross-platform mobile app development is the process of building mobile applications for multiple platforms, such as iOS and Android, with a single technology stack.

This means that instead of creating multiple versions of your app, each written using the dedicated native language for each platform, you can write your code one time and deploy it on several platforms at once.

Advantages of cross-platform development

Cross-platform development and native development each have their advantages and drawbacks. In this section, we’ll review the pros and cons associated with cross-platform mobile development frameworks such as Xamarin and React Native.

  • Write once, deploy everywhere: The most significant advantage of cross-platform development is having a single codebase that you can export to multiple operating systems
  • Uniformity across apps: Having a single shared codebase allows you to maintain the same look, feel, and experience across all platforms. All updates and fixes are also automatically reflected everywhere
  • Saving resources: Instead of having separate teams with different skill sets working on multiple native versions of your app, you only need one team working on a shared codebase. This allows you to leverage smaller teams and quicker development time to save time and money
  • Audience reach: Having your app published on multiple platforms allows you to increase your market reach without any added effort, consequently increasing your chances of getting more downloads and users

Disadvantages of cross-platform development

Below are some of the cons associated with cross-platform development.

  • Performance issues: While cross-platform frameworks work on providing apps that are as close to native apps as possible, they still don’t integrate seamlessly with the respective platforms and have inconsistent communication between the native and non-native components, reducing the app’s speed and degrading performance
  • Inconsistency with platforms: Cross-platform development tools don’t have all the features offered by each different platform, so you might need to employ some workarounds. It may also take these frameworks some time to get up-to-date with the newest features and updates released by the platforms
  • Limited features: There are many native-only features and integrations available in each platform that are not available in cross-platform apps, which limits the user experience you can provide

Cross-platform mobile app development tools

There are many cross-platform mobile app development tools and frameworks available, including:

We’ll take a look at two of the most popular mobile development platforms in 2021: Xamarin and React Native.

What is Xamarin?

Xamarin is an open-source, cross-platform mobile app development framework that was founded in 2011.

We made a custom demo for .
No really. Click here to check it out.

What is Xamarin used for?

Xamarin is particularly useful for sharing code and business logic across platforms as well as writing cross-platform applications in C# with Visual Studio. According to the official docs, Xamarin lets you share roughly 90 percent of your app across platforms. That means you can achieve a native look and feel — not to mention native performance — on each platform without writing in multiple languages.

You can write Xamarin apps on a PC or Mac and compile them into native packages, suck as .apk files and .ipa files for Android and iOS devices, respectively.

Xamarin is used to write apps that serve a wide variety of industries, including energy, media, healthcare, transportation, and more.

Apps built using Xamarin include:

  • Skulls of the Shogun
  • SuperGiant Games
  • Storyo
  • Insightly
  • FreshDirect
  • The World Bank
  • Just Giving
  • Olo
  • Thermo Fisher Scientific
  • APX

Why use Xamarin?

Below are some benefits associated with Xamarin cross-platform mobile app development.

  • Performance: Xamarin apps are known for having almost native-like performance levels
  • Complete development ecosystem: C#, .Net, and Microsoft Visual Studio with Xamarin are all you need to build mobile apps with Xamarin, making it one of the most complete cross-platform mobile app development frameworks out there
  • Seamless user experience: Xamarin.Forms allows you to take advantage of standard interface elements by providing a library of templates so that you can reuse your code across different platforms. You can also use Xamarin.iOS and Xamarin.Android for manual customization, if needed
  • Free: For small teams

Disadvantages of using Xamarin

Now let’s zoom in on some of the drawbacks associated with writing cross-platform mobile apps in Xamarin.

  • Updates delay: Whenever new platform features or updates roll out, there is usually a delay until these changes are reflected in the Xamarin tools, which may cause issues with your app
  • Large app size: Xamarin apps can add around 5 megabytes for releases and 20 megabytes for debug builds, making them larger than native apps. This is primarily due to the libraries used to translate C# calls into native calls
  • Heavy graphics: Xamarin is great for apps with a simple UI. However, building complex applications or mobile games with Xamarin might not be the best thing to do as you will have to spend a lot of time writing platform-specific code, which defeats the purpose of using it
  • Platform-specific code: You might need to re-write some parts of the UI in your app in native code. That means that you will need some knowledge in native programming languages such as Kotlin or Java for Android, and Swift or Objective-C for iOS

Xamarin development tools

The following is a partial list of tools and libraries designed to improve the Xamarin developer experience.

What is React Native?

React Native is an open-source, cross-platform mobile app development framework created by Facebook in 2015. It is designed to enable developers to use JavaScript and React along with native platform capabilities to build mobile apps.

Why use React Native?

Below are some of the benefits of using React Native to build cross-platform mobile apps.

  • User Interface: Implements native UI components, allowing apps to look like native apps, and therefore providing a high-quality user interface
  • Ready-made components: Offers a vast library of UI components, allowing for faster development time.
  • Access to native functionalities: Like camera, accelerometer, etc.
  • Platform-specific code: Allows you to further optimize your separate native apps by using native code
  • Hot reload: Allows developers to apply changes to the apps right away without having to recompile the apps
  • Reliability: Developed and supported by Facebook
  • Free: Open-source platform

High-profile apps built with React Native include:

  • Facebook
  • Facebook Analytics
  • Facebook Ads Manager
  • Instagram
  • Uber Eats
  • Tesla
  • Skype
  • Pinterest
  • SoundCloud Pulse
  • Walmart
  • Bloomberg
  • Discord
  • Myntra
  • Gyroscope
  • Chop
  • Vogue
  • Artsy
  • F8

Disadvantages of using React Native

For all its advantages, there is a small handful of drawbacks you should consider before deciding to write your next mobile app in React Native.

  • Navigation: Navigation built in React Native is not seamless and not comparable to native navigation
  • Complex UI: React Native struggles with building complex animation and transitions

React Native development tools

Below is a partial list of tools and libraries designed to improve the Xamarin developer experience.

Is Xamarin better than React Native?

Now that you have a good idea of what Xamarin and React Native are used for, pros and cons associated with using each, and what high-profile companies use these frameworks to build mobile apps for their customers, it’s finally time to compare Xamarin vs. React Native.

We’ll evaluate Xamarin vs. React Native according to the following criteria:

Performance

One of the most important factors you should consider when choosing a cross-platform development framework is app performance.

While React Native and Xamarin provide near-native app performances, some argue that Flutter’s performance is better because Dart code is compiled to a C-library, which means it’s close to the native code.

This improves communication speed and provides better performance.

However, it’s hard to benchmark performance as it depends on many factors and variables including device, code, app, and features being used.

Popularity

With over 1.6 million developers across 120 countries, Xamarin has developed quite the user base over the years. However, this is largely due to the fact that it is one of the oldest frameworks out there.

Since its release, React Native has slowly but surely gained popularity, surpassing Xamarin in 2017.

Xamarin vs. React Native: Stack Overflow's "2020 Developer Survey"

According to Stack Overflow’s “2020 Developer Survey,” React Native is more “loved” than Xamarin, with 57.9 percent of developers expressing interest in continuing to develop with React Native, as opposed to 45.4 percent for Xamarin.

Development languages

The cross-platform tool development language is another crucial factor to consider when making your decision.

Xamarin uses .Net languages, such as C# and F#, which are common languages and can be used to write native platform code. React Native uses JavaScript, which was not invented for it, but it still does a great job with React Native apps.

You might encounter a few issues or come across some required workarounds as JavaScript was originally developed for the web.

As a result, some APIs might not work, while others may have to be proxied by React Native.

According to the TIOBE Programming Community Index, C# is the fifth-most popular programming language worldwide as of February 2021, followed by JavaScript in seventh place.

This makes both Xamarin and React Native solid choices when it comes to development languages; both work with a familiar language that can help boost your productivity and save you from enduring a steep learning curve.

Components

React Native offers some prebuilt and partly adaptive components, such as buttons and text inputs. However, most of these components aren’t really adaptive. If you need something a bit more advanced, you would have to build it yourself by recomposing these built-in components.

Xamarin.Forms offers a complete cross-platform UI toolkit consisting of native UI components for both platforms, which are compiled into platform-specific UI components.

You can also use Xamarin.iOS or Xamarin.Android for custom app UI and better performance.

Code reuse

Code reuse is what brings developers to cross-platform frameworks, so how much of the code written with each framework is actually reusable?

React Native allows you to write the code once and ship anywhere, but it also embraces platform differences. This means that from time to time, you have to find out on which platform you’re running and load a different component or set of components depending on the platform you’re running. Still, a considerable part of the codebase can still be reused.

Xamarin prides itself on allowing developers to reuse up to 96 percent of their C# code by leveraging the language. Xamarin also offers forms components, making it better for code reuse than React Native and Flutter which share an average of 60–90 percent of codes.

Pricing

While both Xamarin and React Native are free, open-source platforms, Xamarin is only free for individuals and small companies. For large enterprises, single-user licenses start at $499 and go anywhere up to $2,999 for a Visual Studio Enterprise annual subscription.

While this might not be a problem for large enterprises, the costs can still add up, which could cause bigger companies to go with React Native.

Support and ecosystem

When choosing a framework, you should also consider its community support, especially if you’re new to it. This includes forums, documentation, tutorials, etc.

React Native has a pretty good amount of support out there. You can easily find a lot of learning material as well or developers on forums or QA sites like Stack Overflow to ask for support whenever you need any help.

For Xamarin, support is quite limited. However, Microsoft provides some free Xamarin courses and learning paths to help you get started.

Conclusion

When choosing a cross-platform development tool, there is no one-size-fits-all option. Both Xamarin and React Native have proven successful in building great mobile apps. Your specific needs and preferences determine which framework is best for you.

For example, if you already have some prior knowledge of JavaScript, then it might be wise to go with React Native. At the end of the day, it all depends on what you’re building and what you hope to achieve. Any framework will have its pitfalls, but the one where the advantages heavily outweigh those setbacks would probably be the right choice for you.

: Full visibility into your web apps

LogRocket is a frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.

In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.

.

15 Replies to “Xamarin vs. React Native”

  1. “The language offers widgets for both iOS and Android, but you have to switch between both manually as it doesn’t have components that automatically adjust their styles depending on the platform you’re running.”

    Actually some of the widgets have a method that is called “adaptive()”. This will provide a platform specific UI for that widget. For instance:
    SwitchButton.adaptive();

  2. “Continuous integration support: Lacks compatibility with CI tools such as Travis and Jenkins.”

    That’s not true because there’s definitely flutter support in all of the well known CI.

    Flutter provide a rich CLI, where you can do pretty much everything.

    There’s just not enough tutorials on it.

  3. 1 – Search term frequency is a poor metric for popularity; when I am struggling with an environment, my searches go up – when development is comfortable, searches go down.
    2 – “Updates delay” and ” Platform-specific code (maybe)” is going to be an issue with ALL of these platforms.
    3 – Xamarin forms (XAML) applications are 100% code reuse and suitable for most business needs
    4 – Flutter’s “Complete development ecosystem” will not be as complete as the more mature environments.
    5 – Flutter’s “Reliability” because it is a Google product is a questionable statement, as Google has killed off many products shortly after introduction. Flutter could be gone tomorrow.
    6 – Xamarin also has hot-reload, but this is not listed as an advantage.
    7 – Why is React’s may need “Platform-specific code” an advantage, but a disadvantage for Xamarin. Most needs for “Platform-specific code” in Xamarin are handled by Nuget extensions due to the maturity of the product. Meaning they are invisible to the developer.
    8 – Flutter’s use of Dart over Java script and C# is a major disadvantage. Many working programmers are using Java script and C#. Apple’s implementation of Swift was a major blunder — they had to define and redefine it, breaking compatibility, devs had to learn a new (less sucky) language; but at the end of the day C# spec is ECMA open-source -Apple could have saved everybody a ton of headaches by using an established available language.
    9 – Xamarin’s support is extensive through the forum and stack-overflow; MSDN members can actually get dedicated incident support. I wish they would route everything to Stack-overflow as it is a better platform than a forum.

  4. It’s true that recently Flutter has added adaptive constructors to Switch and SwitchListTile. Which is definitely a step towards helping further progress platform-aware widgets within a single codebase. It’s still only just the beginning though but more is expected in the future!

  5. 1st off, thanks for writing this article. Very timely for me. I’m an old timer here (35 years of coding, so far) and want to express my utter dismay with the state of Android programming. I wrote my 1st app in 2012 using Eclipse and Java. It was a bit of learning curve, but not too bad. I didn’t get back into Android until earlier this year. The tools are better (Android Studio)… but Wow, what a mess in terms of languages: Java, Kotlin, Dart (Flutter), Javascript (React), C# (Xamarin), C/C++ (Java NDK), Corona/LUA (?). I agree with jlo 62c’s analysis, especially items 4 & 8. Google is now pushing Kotlin (getting sued by Oracle for Java use?)… but they built Flutter for use with Dart – a whole NEW language!!

    So now, we have to decide: Do I really ‘need’ cross platform (i.e. make the investment to learn DART or strengthen my C#), or do we go with Kotlin, which we believe Google is more likely to support in the future? Maddening. The fact that Google has splintered this Kotlin & Dart (“more options!” if you listen to their marketing dept), gives a bit more strength to the idea of using Xamarin instead.

  6. Hello. A few of the points you made about Xamarin are not true.

    1) “Platform-specific code: You might need to re-write some parts of the UI in your app in native code. That means that you will need some knowledge in native programming languages such as Kotlin or Java for Android, and Swift or Objective-C for iOS.”

    Not true at all. Xamarin has 100% access to Native APIs for iOS and Android and if there’s a library that’s needed in another language, you just create a C# Wrapper/Binding Library to use that feature you want. Absolutely no need for writing native code.

    2) “While all three tools are free, open-source platforms, Xamarin is only free for individuals and small companies.”

    Xamarin is free and open source. You’re confusing Visual Studio licenses and Xamarin which are separate things. I’ve developed Xamarin apps for enterprise clients without paying Xamarin anything.

  7. Dart has been around just as long as Kotlin. They were both introduced in 2011. Frankly, if you develop in C#, you would be effective with Dart in a day. You wouldn’t be learning many new concepts so much as just looking up the syntax for the concepts you already understand. Dart is easier than C# because it doesn’t have as many features. When I develop in either, I increase my skill with the other.

    Dart was selected for Flutter because it has compilation modes and targets that enable its functionality. This was not a mistake, and the benefits are significant. The reason I’m excited about Flutter is precisely the technology mess you mention. I do most of my work in the web space, and the list of technologies there is pretty ridiculous. Dart has made that better for my personal projects, providing a single solution for the gauntlet of technologies and tools surrounding JavaScript development. Now with Flutter, we’re looking at a single framework with a single, easy to learn OO language that can target desktop, mobile and web. I completely sympathize with your exasperation over this mess, but instead of seeing Dart and Flutter as just another piece of that, I see it as a potential solution.

  8. Xamarin hot-reload sucks compared to React native’s and flutter’s reload.
    Only xaml have hot reload any change in the VM or any c# code and you must compile and deploy again.
    Also the unwired deployment is way better in react native with expo:
    As a Xamarin dev for years it hurts but it’s true…

  9. Xamarin (.Forms) dead a long time ago (Even if it’s maintained so hard until now).
    It’s inappropriate that it’s even mentioned here. It shows how not professional this article is.

    Unless it has a serious downside, the important factor is how many third party companies provide SDK for that framework. If you’re not building a toy project, you will have to add many third-party libraries.

    React Native is a clear winner in this factor. It’s very far from others, especially Xamarin.

  10. What world are you living in? Xamarin.Forms is the most widely used product for commercial apps. You ever hear of Guess?

    React Native isn’t anywhere close to Xamarin. Period.

  11. Try TDD and HotReload isn’t a problem. If you’re wiring Xaml and you keep changing code in the ViewModel, you’re doing it wrong

  12. After reading this informative post, I am now sure that I should pick React Native for my next mobile application idea. Thanks for this useful post. However, will it affect the performance of my app or should I opt for native app development? Any suggestions would be of great help.

  13. Hi There:

    I abandoned Xamarin years ago (when it was a paid application) because it was buggy.

    Now, it is buggy but lots less.

    But my main reason to switch back is the use of third party components. The hard part to create a mobile application, its to create the UI. In the case of Xamarin, it’s as easy as to buy a suite, put in the code, duct take with a back code and call it the day. Easy, pretty and functional.

    Instead, if you are programmed native, then you find that there is only a few components around here, and we should do the style by ourselves. And if we do something bad, then it will affect the performance.

    And for React and Flutter, there is nothing. Google gives Material theme but it just tossed it away and the support is quite limited.

    I can spends month building my own components or I can simple buy one.

  14. Can you compare Flutter, React Native and Xamarin? — three of the most popular mobile app cross platform frameworks. We want to consider their structure, tooling, and the kind of applications we can develop with them.

Leave a Reply