Xamarin.Forms or Xamarin Native: Which should you use for your cross-platform app project?
When it comes to cross-platform development tools, there’s no doubt that Xamarin is the gold standard. But once you’ve made the decision to build apps in C# and Xamarin, you’ll need to make one more choice: Should you use Xamarin.Forms, or build directly in Xamarin.iOS and Xamarin.Android? (Note, developers often refer to Xamarin.Android and Xamarin.iOS as “Xamarin Native” or “Xamarin Traditional;” we use the term “Xamarin Native” in this post)
At the highest level, that decision comes down to weighing development time and cost vs. delivering a fully native experience. Xamarin.Forms is an abstraction layer that allows you to push common user interface code to multiple platforms, where if you build in Xamarin.iOS and Xamarin.Android, the UI development work is all done in the native platforms.
Xamarin.Forms gives you the most development efficiency — with Forms, Xamarin says on its site that you could theoretically share “nearly 100%” of code and user interface design across iOS and Android (and Windows Mobile). On the other hand, if you choose to go with Xamarin Native and build the UI on the native platforms, the upper limits of code sharing is around 75%.
To simplify this question, let’s look at the factors that might steer you towards using one or the other.
Four reasons to choose Xamarin.Forms
- Budget is tight
We’ve been building apps for nearly a decade, and budget is a topic that always comes up early in our discussions with potential clients. If your business case for an app MVP(minimum viable product) demands launching on both iOS and Android, and you need to save as much development cost as possible, Xamarin.Forms may be the way to go.
- You need to get your apps to market fast
Whether you’re working with a Xamarin development company like ArcTouch or developing an app internally, the efficiency gain of Xamarin can help get an app to market more quickly. Naturally, using Xamarin.Forms to share more code and UI can mean your project moves along even faster.
- You want your apps to be simple to update
One of the biggest, yet sometimes overlooked, benefits of using Xamarin for multi-platform apps is that, with a single code base, the process of updating and maintaining those apps over time is simplified. This is especially true of Xamarin.Forms. When much of the UI is also shared, that means feature updates can be much more easily rolled out to both Android and iOS.
- Your internal team is more experienced with .NET than Android and iOS
There are a lot of nuances to the mobile platforms, especially when it comes to user interface design. If your development team has a rich history in Microsoft technologies and C#, you can do the most in Xamarin.Forms. But this doesn’t mean you can publish a winning app without some mobile expertise. It does mean, however, that you’ll spend less time developing directly in the native platforms.
Three reasons to choose Xamarin Native (Xamarin.iOS and Xamarin.Android)?
- You need your app file size to be small
The Xamarin.Forms abstraction layer that allows you to build for iOS and Android typically leads to a larger app size. Together with the increased overhead, this typically means the loading process for an app takes longer, particularly on Android. Xamarin and Microsoft have made great strides in performance improvements across the board for Xamarin since the two companies joined forces in early 2016. But there’s no denying that a multi-platform app built in Xamarin.Forms can end up bigger and slower. So, if your app needs to be lightning fast to deliver a great UX, you may want to choose Xamarin Native.
- Your app has a lot of animation or complex UI
If your application has a complicated UI with lots of intensive graphics, you might need to go with Xamarin Native to ensure optimal performance. Xamarin.Forms, like the name indicates, was conceived to offer a UI framework geared for clear decision-based or form-based flows through an app. Highly dynamic content may be better suited for an app that’s coded in C# with Xamarin but designed on the native platforms in Xamarin.iOS and Xamarin.Android.
- You want to use a native feature that’s not available on both platforms
Android and iOS seem to be chasing each other with each release in terms of what features each platform offers. But there are some features, and even UI controls, that are exclusive to one platform. Xamarin.Forms doesn’t provide an abstraction for these features because there’s nothing cross platform about them. As a simple example, iOS has a widget called a “segmented control,” for which Xamarin.Forms doesn’t have an analogous control. You can always implement controls like this yourself in Xamarin.Forms, but that’s more time spent developing UI widgets and less time spent polishing your business logic. So, if there are make-or-break UI elements that you must have in your app and that aren’t cross platform, Xamarin Native is probably the way to go.
Don’t let this be a reason to steer you away from Xamarin.Forms…
Finally, I want to address a reason some companies have steered away from Xamarin.Forms in the past. There’s a misconception that you can’t design beautiful apps using Xamarin.Forms. If you’ve used the GUESS Jeans app or G by Guess, designed and engineered by ArcTouch, you might be surprised to find out it was built in Xamarin.Forms. It’s a visually stunning app — and I’ll get more into that in my next blog post, which will be about how Xamarin.Forms is a lot more powerful than many developers and designers realize.