Pros and Cons of Mobile Development with Xamarin

Learn about the pros and cons of using Xamarin as your main mobile development platform. All the advantages and shortcomings of ‘near-native’ cross-platform enterprise development laid out in one guide.

Category
Mobile

When it comes to mobile development technologies, the consensus often goes along the lines of ‘if you can afford it, go native’.

In reality, though, it’s often not that simple. What’s the type of app being developed? Is it for iOS, Android, both, or more platforms? Will it be graphics- and animation-heavy, with a unique intricate GUI? What’s its business logic?

Depending on a project’s specifics and budget, choosing hybrid or ‘near-native’ cross-platform development can prove a tremendous boon saving time and resources without sacrificing much in terms of performance and looks.

The ‘big names’ of the multiplatform app development world include but aren’t limited to frameworks and platforms like Cordova, React Native, PhoneGap, the newcomer Flutter, and Xamarin, which is heralded by many as number one.

What Is Xamarin?

Xamarin is an open-source framework for building cross-platform apps (for Android, iOS, and UWP) from a single shared C# codebase.

Originally based on the Mono project, Xamarin was acquired by Microsoft in 2016 and since then has been integrated into the .NET platform. By now firmly a member of the C#/.NET/Visual Studio family, Xamarin is one of the most popular toolsets for multi-platform mobile development in the world.

That’s all fine and dandy, you can say, but why and when exactly should one choose it instead of building native Android and iOS apps separately? What are the main advantages of Xamarin development, and what are the drawbacks?

Let’s dive deeper into the specifics of Xamarin and see what makes up this product’s unique strengths as well as weaknesses.

Learn all about the pros and cons of Xamarin from both business and developer standpoints #XamarinDevelopment #Xamarin
Tweet

Xamarin Pros

Below is the list of prominent advantages Xamarin has to offer.

Pro: Code Sharing, or ‘Write Once, Use Everywhere’

The possibility to build single-code solutions for iOS and Android (as well as other platforms) is the main selling point of Xamarin and similar frameworks. While a 100% shared codebase between very different platforms is yet to be achieved, Xamarin is one of the most effective options in this department, providing 60% to 95% of reusable code with native performance, UI and controls, all written in C# within the .NET framework.

Depending on the project, Xamarin apps share from 60% to 95% of codebase on average—all while providing close-to-native performance #XamarinPros #XamarinDevelopment
Tweet

Pro: Support and Full Technical Backing by Microsoft

Despite common prejudice toward corporations, the fact that Xamarin is a part of Microsoft’s software development bundle puts it above many competitors thanks to:

  • Guaranteed continuous developer support

  • Wide learning opportunities

  • Stability and performance, especially for products like Test Cloud

All of this is possible because Xamarin has the backing of one of the biggest tech giants in the world. Even though Microsoft officially stopped supporting Windows Mobile last year, Xamarin is still considered a top-priority product with no chance of it being retired or abandoned anytime soon.

Pro: Flexibility of C# and .NET

Xamarin’s main programming language is C#. If you’re with a development company that has its fingers in many production pies at the same time, chances are you’re already using this language in some capacity. Given the nature of C# and .NET, as well as Microsoft’s overall .NET for everything stand, a single development team should be able to easily switch between apps for various platforms by design.

Taking into account this mentality of the expansive .NET development ecosystem and the fact that these days practically all enterprise-level development companies have C#/.NET specialists on board, opting for Xamarin can often be only logical.

If we talk about developing for enterprises specifically, over 80% of code on average are reusable between iOS, Android, and other platforms in Xamarin and C#. This means lower development costs and more flexibility for your team. While some can consider C# a disadvantage, its flexibility and the simple fact that you can do almost anything in one language without ever needing to touch Objective-C, Swift, or Java, easily outweighs the drawbacks.

For more pros of Xamarin from a business perspective, read our recent review.

As a part of Microsoft's C#/.Net family of development tools, Xamarin inherits most of their strengths—and a few of weaknesses #Xamarin #XamarinDevelopment
Tweet

Pro: Minimal Time to Market

Time to market is essential when you develop a highly competitive commercial app or you’re on a tight deadline. With Xamarin’s code sharing capabilities and Test Cloud service, you can easily run tests through 2,000 devices and quickly learn about all possible code inconsistencies within your app. You shouldn’t underestimate the importance of this opportunity, especially when you have limited hardware and human resources.

Pro: Native Performance and Integration

With Xamarin, you’re getting the level of performance comparable to a native app. How does it work? Apps made with Xamarin utilize a range of native elements and technologies for highly optimized results, including:

  • 100% native API access. One of the recent developments, the Xamarin.Essentials library provides easy access to core overlapping native APIs, while Xamarin.Android and Xamarin.iOS take care of everything else.

  • Native UI. Xamarin.Forms takes advantage of standardized, guide-compliant controls and GUI elements, while dedicated iOS and Android options can be employed for unique visualizations or anything platform-specific.

  • Overall process optimization, i.e. hardware acceleration, native compilation, backward compatibility, faster app launch with Android App Bundle and Startup Tracing, and so on.

Pro: Know Your Every Crash and Activity

With Visual Studio App Center (functionally the successor or Xamarin Insights), you will know everything about your app crashes, user activities, devices, and much more. With this handy tool, your quality assurance will become more effortless and fluid.

As is standard for .NET, you get the ability to build, test, and oversee not only Xamarin projects but also those involving native iOS, Android, and Windows applications, as well as macOS, Cordova, and more—all in one place.

Visual Studio App Center makes for building, testing, and managing environment for .Net projects including, but not limited to: Xamarin iOS, Android, and Windows applications, as well as macOS, Cordova, and more #XamarinPros
Tweet
Meet your Xamarin development dream team

Pro: Quick GUI Prototyping and Next-Level Code-Sharing with Xamarin.Forms

Do your apps require an appealing yet fairly standard GUI? Then Xamarin.Forms is for you. A cross-platform GUI library for Android and iOS (also macOS, watchOS, tvOS, and others), Xamarin.Forms is currently one of the simplest ways to build cross-platform user interfaces that are compliant with the guidelines. One of the many perks, aside from all-native elements and controls support, is C# and simplified XAML coding, with no need to cater to any specific platform.

Before Xamarin.Forms came into play, building GUI with the framework was the blind spot where code sharing was practically unattainable. While having all the necessary tools for platform-specific development, Xamarin.Android and Xamarin.iOS didn’t really provided much in terms of GUI reusability.

That all changed with the coming of Xamarin.Forms (or at least once it got up to speed a couple of years later).

Now, with the right project, using Xamarin.Forms can drive the percentage or reused code up to a whopping 95%, providing the ultimate code sharing experience. This skyrockets development speed and drives down costs to a massive degree, making the “write once, use everywhere” mantra a lot closer to the harsh reality.

Xamarin.Forms keeps getting better, too, with the fourth version rolled out in May 2019, bringing a number of upgrades. These include Shell with new options for streamlined development with a fully visualized hierarchy, shared navigation, and integrated search options.

Recent Xamarin updates brought about several noticeable improvements, with the addition of Shell to Xamarin.Forms for streamlined GUI development being especially notable #XamarinDevelopment #XamarinPros
Tweet

Pro: Code Maintenance

Maintaining an app in a working condition is especially tricky when you have more than one platform involved. Every little functional change has to be propagated through other platforms. Xamarin is a definite advantage here, given interchangeability of codebase between iOS, Android, and other platforms.

Maintenance also means keeping up with each platform’s versions and updates, and here Xamarin has got you covered, too. For example, Xamarin.iOS not only includes support for mobile iOS, tvOS, watchOS, and macOS but also allowed developing for Beta iOS 13 (yes, iPadOS too) months before the official stable release.

This reduces the time required to maintain, debug, or update code when necessary. The cross-platform experience enabled by Xamarin can save you hours and days that could otherwise have been spent on upgrading each app for each platform separately. As a result, everything stays up-to-date and time and money get saved, especially if you outsource to a third-party developer.

Pro: RMAD and .NET Embedding

Rapid Mobile App Development (RMAD) is a relatively new concept that incorporates tools and products which significantly decrease the time required to develop an app, and additionally enable non-tech or less code-savvy users to participate in development. Xamarin was made for RMAD, but one specific feature of Xamarin.Forms stands out: .NET embedding.

RMAD at a Glance

  • Defined as the use of code-free programming tools to speed up application development for mobile platforms.
  • Enables quick building and managing of ‘good-enough’ internal apps to address specific business issues.
  • Based on the concept, higher-quality products can be developed faster through more expedient processes, such as early prototyping.
  • Geared toward domain experts and line-of-business staff who have the business knowledge but not necessarily advanced coding skills.

It allows you to feed your .NET production code into other programming languages. So, if you already have an app, you can port its code to a different app through Xamarin, given that this code supports .NET embedding. This significantly improves code interchangeability and versatility.

Pro: Microsoft Learn for Xamarin (previously Xamarin University)

One thing that defines the longevity of a platform or a technology is the access to comprehensive, systematic, high-quality education for its users. The official Microsoft Learn platform and its Xamarin courses are a perfect example of a robust educational ecosystem for users of any skill level. A lot of the courses are self-paced, so developers can quickly fill the gaps in their expertise with Xamarin on a personal schedule.

If something is missing in the courses, welcome to Xamarin Forums, where a vibrant online developer community can quickly help you find answers to anything previously left unclear.

With the deprecation of Xamarin University, the best way to learn the ins-and-outs of the framework is with the official MS Learn resources—and Xamarin Forums #XamarinPros #XamarinDevelopment
Tweet

Xamarin Cons

But it’s not all positives when it comes to Xamarin. Here are the shortcomings to consider before choosing the framework.

Con: Pricing

Right off the bat, the first disadvantage of Xamarin is the price.

On its own, Xamarin comes free and open-source as a part of the .NET platform. Commercial development, though, calls for using the Microsoft Visual Studio integrated development environment (IDE); and its licensing doesn't come cheap.

Unless we’re talking very small or non-commercial projects, the choice is either to shell out $1,199 for the annual Professional subscription ($799 for subsequent years) or, better yet, an eye-watering $5,999 for the Enterprise license for the first year ($2,999 subsequently).

The Enterprise subscription is also the only tier with collaboration options, multiple accounts support, and automated testing tools bundled in. While there is the limited free Community edition and some possibilities to work with other IDEs, those mostly don’t cut it for big teams or commercial development projects.

The annual fees for the Microsoft IDE aren’t a problem for a professional software development company, but it can be something to consider when going with in-house development.

#XamarinCons: while there is the free VS Community edition (for teams of 5 people and less), using Xamarin for enterprise development usually means going with the Enterprise Subscription plan for Visual Studio—and its hefty price tag
Tweet

Con: Platform-Specific Limitations

No matter how close Xamarin gets to native development, when building single-code solutions for multiple platforms, some limitations are bound to surface. For example, some workarounds are necessary for multi-touch functionality and certain platform-specific gestures.

These have been observed for the longest time, so developers took it into their own hands given Xamarin’s open-source nature. You’ll find lots of Xamarin gaps filled thanks to developers who got tired of waiting for official support.

On the one hand, things like that are great as the community members are expanding the library. On the other hand, if there’s a function that you need in the app and it’s not supported, you’ll have to ‘take care’ of it yourself.

Here are the examples of the current platform-specific limitations of Xamarin mobile development to be aware of:

Xamarin iOS Limitations

  • Limited generics support

  • No dynamic code generation

  • No remoting

  • Runtime features disabled

  • Some .NET API limitations

Xamarin Android Limitations

  • Limited dynamic language support

  • Limited Java generation support

  • Partial Java generics Support

Con: Limited Community (Compared to Platform-Specific Ones)

Probably the biggest disadvantage of all hybrid app development products is the community, or rather its absence. The number of developers working with all major platforms simultaneously is naturally smaller than of those dedicating their time and efforts to a single platform.

On their own, huge long-lived communities for ‘pure’ iOS and Android naturally outnumber anything even the best of hybrid mobile app frameworks have to show. Xamarin, despite being one of the top choices for cross-platform mobile development, doesn’t hold a candle to major platforms in terms of presence, accumulated communal knowledge, and experience.

Specialization is the key to success in many app development niches, and, compared to the giants, communities for Xamarin and other similar tools are pretty limited. At the same time, things are improving in terms of the ecosystem and API robustness, and the platform steadily gets more popular.

C#, .NET, Visual Studio and WPF developers are still naturally attracted to Xamarin, new talents are joining in, and even some dedicated single-platform developers jump ships too, so Xamarin community only keeps growing as time goes by.

Going for cross-platform development, whether it's with #Xamarin, React Native, Flutter, or other frameworks—is always about compromise. It manifests in both platform-specific limitations and comparative under-population of dev. communities
Tweet

Con: IDE and Technology Lock-in

If one day your company switches its course to working with different toolsets, IDEs or languages, you’re in for some rough time. Any code written in Xamarin can only be used within the.NET development stack. This means that you can’t reuse it for a native app or for any HTML5 apps, which can limit code longevity and usability.

Con: Code Overhead

Xamarin has to work with various platforms at the same time, which means that apps created through Xamarin can have an overhead. To put it simply, they’re overcomplicated to allow smooth integration.

The downside of this is the fact that Xamarin-built apps are ‘heavier’ and may take up more space than native apps, simply because native apps don’t need that shared functionality. However, the Microsoft Xamarin department keeps working on it diligently, and Xamarin-based apps are getting lighter and faster with time—Forms and Essentials being the greatest aids in that so far.

Con: API Support Lag

It still takes time for Xamarin’s API to be updated. So, for example, when a new SDK for iOS, Android, or another platform is released, Xamarin needs to properly integrate it into its ecosystem to maintain code sharing.

This means that your developers can’t start working on new features for your apps until that support is enabled. Microsoft’s Xamarin department strives for same-day releases for system updates, but keeping up with every beta and various new features introduced for Android and iOS is not completely lag-free, which can be a bit of a competitive bottleneck.

Specifically, Xamarin’s Android support usually lags behind that of iOS (releasing APIs for new Android SDKs usually takes longer). If your focus is on Android, you might want to keep this limitation in mind.

Con: UI + Graphics Code Shareability

If you’re not using Xamarin.Forms, you’ll still need to develop UI for each of the platforms separately. There’s no single framework that can be shared between all of them completely. Yes, certain elements can be extracted and duplicated, but not the entire UI. This means that your development team should still know their way around Objective-C, Java, Swift, and Kotlin to properly build a foundation for all the UI elements.

On average, apps built with Xamarin can share anywhere between 60% and 80% of the code, mostly the business logic and some of the APIs and GUI, thanks to Essentials and Forms. The rest is platform-specific, though and, depending on the app, can grow to be too much of a hassle, canceling the code-sharing benefits.

It does depend on the libraries you use, as more of them become available through community support that we mentioned above. So, you can increase the margin of reusable code, but that requires a level of ingenuity from your development team.

This same limitation makes building complex GUI-heavy apps much less beneficial in Xamarin. Essentially, it’s not advisable to utilize Xamarin for applications like that, as the UI for each platform will have to be largely built from scratch. The same is true for even less complicated apps where you’d want to add specialized platform controls, like a custom view in iOS.

#XamarinCon: Xamarin.Forms might be great for a standardized GUI, but if your cross-platform app's visual design and actions lean towards unique and creative, the codesharing benefits can get canceled out quickly (same goes for games)
Tweet

Con: Not for Game Development

Stemming from the previous disadvantage, developing games with Xamarin is often considered lackluster. The logic behind it is the following: if code-sharing and time-savings aren’t all that great with Xamarin-based games and you still need to build two or more separate apps, you should do it natively.

It should be noted that there are definitely options for creating .NET/C# games in Visual Studio, mobile and multi-platform ones included.

MonoGame is a popular framework for developing cross-platform 2D and 3D games in .NET/C#, notable examples being Transistor, FEZ, Bastion, TowerFall, and Infinite Flight. Other options for developing cross-platform games in .NET are Cocos2D and Unity. All of these tools can be used for developing games with C# in .NET/Visual Studio and, by proxy, Xamarin.

Still, despite all that, Xamarin is rarely a mobile game developer’s first choice. Games, with all their interactive UI elements, simply don’t make room for meaningful code sharing and productivity gains. For the time being, ‘write once, play everywhere’ still remains Xamarin developers’ dream.

So, Does Xamarin Have a Future?

With all its flaws and limitations, Xamarin remains one of the most robust, extensive, and productive cross-platform app development platforms. With Microsoft’s strong backing and regular powerful updates, as well as a growing community of developers, the flaws are being taken care of, and the future is bright for this multifaceted ambitious project.

Contact us