Native App Cross Platform Development – Choosing an Approach
Mobile development is a highly specialised area. Today, iOS and Android devices share over 90% of the smart-device market. Both arguably offer similar features yet have different development and deployment environments. Apple provides Xcode for developing and deploying iOS apps to iTunes. iOS developers code using Objective-C or (now) Swift. Android is based on the Open Source Java Development Kit. Android developers typically develop apps in Java and deploy apps to Google Play. These approaches and environments are similar in many ways but also different and require different skillsets. The market typically demands mobile apps on both iOS and Android devices. Optimising development and maintenance costs is a significant factor and is often underestimated. Effective cross platform development has been a generic Holy Grail for decades. Modern computer languages and Web technologies have bought us closer to realising cross platform development. The objective of this article is to help you make an informed decision for selecting a Native App Cross Platform Development Approach.
Xamarin is a C# platform and toolset that developers use to write native Android, iOS, and Windows apps with native user interfaces from a shared codebase. Developers can code in C# and may code the UI in C# or XAML – an XML-based mark-up language developed by Microsoft. Xamarin provides a generic layer called Xamarin Forms that allows developers to develop apps in a generic manner that is platform independent. A Xamarin Forms app looks like and behaves like an iOS, Android or Windows app from the same codebase. Xamarin compiles C# to native code and therefore runs very fast. You get access to C#, Xamarin and NuGet libraries which provide extensive functionality. Over 1 million developers use Xamarin in more than 120 countries. Xamarin was purchased by Microsoft in March of 2016.
Microsoft Visual Studio is the recommended Xamarin development environment and is now available on Macs. Xamarin Studio is also available for Macs and is an excellent toolset similar to Visual Studio. Both development environments are highly productive and offer significant tooling including IntelliSense editing, source control, package and library management, debugging and release management. To deploy iOS apps and run the iOS simulator access to a Mac is required to host Xcode.
Here is a summary of some important features you should consider.
|XAML UI mark-up option||Angular 2 data binding and connectivity|
|Xamarin Forms for generic development||Web based generic development|
|Native compiled apps||Native apps running on JVM|
|Native UI controls||Web Controls|
|Code sharing 90%||Code sharing 90%|
|Visual Studio – a powerful environment||Open development environment|
|Web Integration support available||Web Integration is inherent with Angular|
|Backed by Microsoft, freely available||Open Source, backed by Progress|
|Established with a large user base||New with a smaller user base|
|Extensive support groups||Emerging support groups|
So which way do you go?
Consider NativeScript if:
- You want to reuse code between your web projects and mobile projects
- You have investments in web technologies
- You are comfortable writing TypeScript
- You are invested in Angular 2 or moving to Angular 2
- You prefer Open Source collaboration
- You want to use 3rd party open source components
Consider Xamarin if:
- You have developers familiar with C#
- Your skill base is C# and would rather not retrain in Web technologies
- You have no investment in Angular and no plans to do so
- You prefer NuGet as your package manager of choice
- You are invested in Visual Studio
- You don’t like command line, and would rather do things visually
- Extensive support from Microsoft and the community
Both technologies are very good and well supported. For me the decision to which way to go should be based on the technologies and skillsets you currently have and where you are headed. If you are invested in Microsoft technology and happy then Xamarin could be the right choice. On the other hand, if you are invested in Web technologies then NativeScript could be the right choice.