NML Blog

Recent posts

Why We Use Xamarin To Develop Native Mobile Apps

As with skinning a cat, there is more than one way to build a native mobile app. Native mobile apps are written to target a specific mobile Operating System (e.g. iOS or Android), using the native API. They have full access to the device’s functionality (camera, networking, geolocation, file storage, database, push notifications), and look, feel and react like apps that are native to the device. Native apps run “close to the metal”.

Hybrid mobile apps are written in HTML5 and JavaScript, and run in a browser contained in a native app wrapper. Ultimately it is a website that runs as a (free-standing) app, but has more access to native functionality than a web app running in a mobile browser.

Generally speaking, native mobile apps offer better performance (responsiveness and speed), and offer a more intuitive and natural UI using standard, native UI controls. But this blog post is not about which is better (native or hybrid) – that will be discussed in a different post.

Cross-Platform Native Apps

Native apps are traditionally developed in the native programming language of the platform on which they run: Objective-C (and now also Swift) for iOS, Java for Android, and C# for Windows Phone. The source code cannot be shared or used across the platforms, so a Java class file for example cannot be used in an Objective-C program. The net result of this is that an app has to be created from scratch for every platform that needs to be supported, usually by a different team as it requires specialized knowledge of the specific programming language.

Over the past couple of years technologies and frameworks have emerged that allow for the development of cross-platform native apps: developed in one platform-agnostic programming language, but still having full access to native API’s and OS functionality.

Xamarin (originally called MonoTouch and Mono for Android) allows for the creation of native iOS, Android and Windows Phone apps using C#. Because the same programming language is used for all three platforms, code can be shared amongst platforms. Typically, the core functionality common to the apps (business logic; data access) is abstracted into a separate library, and a custom, native UI is crafted for each platform. Generally speaking (and depending on the complexity of the UI), 60-70% of code can typically be shared.

Xamarin Cross Platform

Using a cross-platform approach to create native apps using Xamarin has the following advantages:

Native app end-product

  • Availability of native functionality
  • Native UI look and feel
  • App speed and responsiveness

Shared codebase

  • Quicker development time on multiple platforms
  • Easier maintenance: fix bug once for all platforms
  • Easier to add new features and functionality

C# as development language

  • Modern language with modern constructs (Linq; Async-Await)
  • Skills are readily available
  • One team can produce app for iOS, Android and Windows Phone

Conclusion

At the end of the day, the specific requirements of an app should dictate whether to use a hybrid or native approach. However, if a native app is the choice, the advantages offered by using Xamarin over “true native” are very compelling. Native app development is notoriously complex and expensive; (almost) halving development time and expense by using a cross-platform technology makes a lot of sense.

Need a software development partner?

Get in touch