Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

Xamarin vs Native: Which is the Right Development Platform for your Enterprise?

Author: Techno Phile
by Techno Phile
Posted: Oct 26, 2015
Cross-platform mobile development allows developers to come up with a single codebase that can be used across operating systems. iOS and Android OS are very different from coding level, so developers often face unique challenges when creating apps. A 'one size fits all' approach may not work here. Cross platforms, aka Hybrid platforms, mitigate this problem by allowing programmers to use just one set of code to create totally native apps.

The debate between Xamarin vs native development is a never-ending and one that doesn't have a right answer. It is next to impossible to say that one wins over the other in all respects. Having said that, let us evaluate Xamarin mobile application development and understand whether it can replace native development.

Why Xamarin?

With Xamarin, you can use C# to develop across platforms. This language has evolved considerably over the years and lets you develop quickly. Updates in C# include generics, LINQ, implicit typing, extension methods, async methods, and closures assists in the creation of readable and reliable code.

In addition, the shared core code between iOS and Android is quite simple due to the MVVM Cross restrictions. The parsing logic, models and networking are shared between both the versions of app. What this means is, functionality is maintained, bug discovery is easier and the possibility of similar operations between both apps goes up considerably. Also, out of all the bugs reported in Xamarin, a very few of them are platform-dependent, meaning the fixes can be applied to either platforms easily.

Moreover, Xamarin's native APIs emulate the native experience very closely so if you know the API, an equivalent Xamarin for it can be found. Xamarin ensures certain native calls meet the C# rules and features (for example, events, delegates and properties). What this does is, makes it easy for developers who are transitioning from native to Xamarin.

Some Concerns:

MVVM Cross Magic can be a strong platform for cross-platform development as it requires a distinction between Model, Model-View and View. However, in some cases it may not perform the expected operation. For instance, initializing new model views requires the initialization parameters to be serialized, and this may not work well with overloaded Init methods. This makes it more cross-platform but confusing.

Portability is another area of concern. While most of the code in the core layer is portable, it is likely that the structure of the View Model (VM) is made to work with the View in one platform or another. An Android or iOS developer creating the VM may turn data structure according to their platform preferences/views. Xamarin developers also tend to be biased towards iOS or Android. For complicated apps, this may become an issue until developers become used to making concessions for all platforms.

The role of third-party libraries cannot be ruled out. On iOS and Android, as a developer, you may be used to 3rd party libraries with UI elements that have made your life easy on your chosen platform. While Xamarin may offer bindings for the popular libraries, you may need to provide bindings sometimes and this is not super easy with Xamarin.

Think About:

Xamarin is not native. It may take C# and compile to native code, but still uses Mono runtime for the job. The use of Mono implementation means it may or may not be optimized for the chosen platform. In addition, objects in C# are garbage collected, so not being careful enough may lead to an issue during memory allocation. Also, where iOS library calls are P/Invoked direct to native code, calls into Android need to be taken out of C# and put back into Java so that the proper Android function can be called. All of these can have an impact on app performance.

To Conclude:

Ultimately, the selection of the development platform boils down to the project and developers who'll be supporting the code in the long term. Some other factors may also affect your decision.

  • If your organization has vast Java or Objective-C teams, you know which way to do.
  • Xamarin is an excellent choice for apps that have a sizable business logic and standard designs. If you have an app with advanced presentation layers and little business logic, then you may not be able to take full advantage of Xamarin. The best bet in this case would be to go native and make use of native platforms and toolsets.

Hence, both these paths can get you where you need for most of the projects. But, each of them have a different set of attributes that need to be carefully evaluated depending on organizational requirements and project restraints.

What do you prefer – Xamarin or native mobile app development? And why? Let us know in the comments below.

About the Author

A never-ending debate in mobile development circles remains whether to use a cross-platform tool such as Xamarin, or develop apps natively. Before you decide, make sure you evaluate it's pros and cons!

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Techno Phile

Techno Phile

Member since: Sep 30, 2015
Published articles: 1

Related Articles