TechnoparkToday.com > When the Apple corporation unveiled the iPhone in the year 2007, they did not expect people to write applications and bake it into their Mobile devices. The idea was to use the Micro browser in the phone to access web pages produced by Server applications written in LAMP,JEE,.NET or other technologies.
iPhoneOS,( later christened as iOS) was stripped down version of MAC OS X and is based on the Open Source project,Darwin. This enabled a team of hackers to reverse engineer the native APIs and they created an Unofficial SDK. They also created a market place for downloading apps to a Jail broken iPhone. This prompted Apple to come up with a official SDK and a market place for the native Apps..
Ideally, the credit for the idea of a market place should be given to the group of hackers who created the unofficial SDK. Steve Jobs got the credit and was able to revive the fortune of the Apple corporation. Apple followed iPhone with iPad, their tablet platform.
Then, Android OS and Phones/Tablets made with Android appeared on the Market. Microsoft also Jumped into the fray ( they were pioneers in the Tablet market and were a OEM OS vendor) with their Windows Phone OS. Even, Blackberry corporation was forced to create an SDK for their Phones. In the ensuing market war, Android , iOS and Windows Phone OS emerged as the three dominant players in the market.
There was a catch with each of these platforms. You have to learn
XCode,iOS SDK and Objective C to program an iOS device
Eclipse, Android SDK and Java to program an Android
Visual Studio, Windows Phone SDK and C# to program a Windows Phone
This led the emergence of platforms like PhoneGap and Sencha touch. They did embed a Mobile browser inside a UI control and provided some abstraction to enable people to code in HTML5 ,CSS and JavaScript. To access Native API,they had host language interface. They are also called Foreign Function Interface. This particular stack is called Hybrid Application development.
When the Google corporation released their JavaScript engine, the Google V8, as an Open Source project, it led to the emergence of Mobile Application Development Platforms ( MADP). The companies began to offer an Eclipse based environment for creating the UI layout, a JavaScript based programming model on the Google V8 and a Platform Abstraction Layer for writing your Apps. IBM Worklight and Kony Corporation’s Kony One platform and Titanium etc. are the key players in the arena. These companies offer server based solutions for MAM ( Mobile Application Management) and MDM (Mobile Device Management) etc. These server offerings are also called MEAP.
Until mid-2013, there were four options to develop your Mobile based Application development
Mobile Web – Micro browser based apps which renders content from Server Technologies
Hybrid – Browser embedded in a Native Container
MAD – Mobile Application Development Platforms like Worklight and Kony
Native Applications – Written using Objective C(iOS),Java(Android) and C# (WP8)
Each of the application development model had it’s own pros and cons. Depending upon the scenario one can choose the proper Application development model and has to live with the associated problems as well.
A question popped up in the mind of the developers,”How about using a Single Programming Language with a Single IDE to write your Apps which runs on All the Mobile devices as a Native executable?”. Everyone thought, it is impossible!
When Xamarin reached critical mass, people got such a platform!. Xamarin platform uses C# as the programming language, Xamarin studio as the IDE and uses LLVM / Ahead of the Time (AOT) compilation to generate true native applications.
Let us dissect it further, the Xamarin uses
C# as the programming language -IMHO, C# is the most advanced language available out there with support for OOP, Generic Programming, Functional Programming, Logic Programming (LINQ), Native Interfaces ( unsafe, P/Invoke/COM-Interop), Dynamic programming etc. Xamarin is based on the Mono Platform, which is the .NET implementation which can run on all platforms. In fact, Xamarin was created by a team lead by Miguel de Icuazza, the father of the Mono Platform. Instead of using Just in Time compilation, Xamarin uses Ahead of Time Compilation technique.
Xamarin is using LLVM, the world’s foremost compiler back-end. C# uses P/Invoke to directly bind to the native API of the Platforms. So, it is not a poor wrapper around native API. One has to understand iOs programming model to program iOS devices, Android programming model to program Android devices and Windows Phone programming model for targeting Windows phone devices. You can use C# as the programming language for all platforms. The back-end code can be easily shared using Portable Class Library mechanism provided by .NET Platform. Only UI code, needs to be specific for each platform.
Xamarin Studio – You can use Xamarin’s IDE to develop your applications. By using a single IDE you can develop true native applications. You require only one MAC OS X machine available inside your development network. It is a tremendous saving. Xamarin is endorsed by a big brother company based out of Redmond. That is the reason, it has got a Visual studio Pluggin.
Native applications – Low Level Virtual Machine is a project started by Vikram Adve and his student,Chris Latner. They created a Compiler infrastructure which is being leveraged by Clang compiler. Clang compiler is a drop in replacement for Objective C, C and C++ compiler from GNU Compiler Collection (GCC). The advantage of LLVM is the license, as it is released under the BSD License. For FreeBSD and MAC OS X/iOS, LLVM based Clang is the default compiler. Thanks to LLVM, Xamarin can generate native executables using the Ahead Of Time compilation strategy.
Because of the above technical reasons, Xamarin enables us to write Bring Your Own Device (BYOD) applications using a single programming language and run as native applications. What more can you ask for?
I recommend Xamarin because
Lot of people already know C# very well.
One can avoid learning lot of languages to program a device
A good BYOD development platform.
Sharing sizable business logic which is supposed to be executed on the device.
Reduces the development cost
One Single IDE
Lot of other options coming your way within the platform
If you want Native code and has to bring something to the market fast, Xamarin the best choice out there. Thanks to Xamarin, we have got a fifth development option
Two Frequently asked Questions
What is the difference between Xamarin and PhoneGap?
PhoneGap is a native container with a frame inside where Web Browser control can be embedded in it. The wrapper is native,but, your applications are using HTML5/CSS and JavaScript. Xamarin generates true native code as it uses C# and LLVM to generate native code for respective platforms. In Xamarin, you have understand respective programming model of the specific platforms for the front end code and your using C# as a programming language. One language for all platforms for native development. The faceless classes are common across platforms and aligns itself to Microsoft C#.
Android has got a Virtual Machine, How Xamarin works with it?
Anroid has got a Java virtual machine (Two options are available) and how Xamarin will work with a JVM is a doubt which is commonly encountered. Google has published Google NDK ( Native Development Kit) and Xamarin binds to the NDK. Xamarin makes up for the JNI ( Java Native Interface) layer delay with lightning fast AOT code. The new Android Run Time ( ART) is trying to address the Android performance with Ahead Of Time compilation
Author Info:Praseed Pai has been working in the IT/Engineering Software Industry for more than two decades and has presented seminars/workshops in more than two hundred technical events. His areas of interests are Programming Languages, Computer Graphics Programming, Native Code Programming, Embedded Systems and Enterprise Computing.
Xamarin benefits are extremely visible in the business shere. Here are some of them outlined in the infographic below:
gloriumtech.com/blog/xamarin-development-mobile-apps/