With a plethora of options for building mobile apps, be it a “build for each platform”, or “build once for all platform” strategy, there is a lot of argument around what path is the better one. The main points discussed are whether the Native or Hybrid approach is more appropriate. My response to a lot of these discussions has and, I think, always will be IT DEPENDS.
Going Native – Programming in the native language of the platform, I think, will always be the preference. Especially for applications that require the innermost workings of the platform. Apple iOS has Objective-C, Android has Java, and Windows Phone has .NET. Well, I guess we can’t forget about the Blackberry platform which primarily is built using Java.
Going Cross-Platform (Hybrid) – Today, there are more hybrid solutions to mobile development than one can keep up with. I liken the hybrid route to traveling to a foreign country, say France, where French is the primary language (like…obvious), but since I don’t speak the language fluently, I use a mixture of English, and hand gestures. It works, and will probably help me communicate decently, but it only goes so far, and can only accomplish so much. At some point, I’ll need to speak French. Some big players in this field include Sencha, Phonegap, & JQuery Mobile, just to name a few. I have personally played around with Sencha the most, and while it is an incredible platform, I found it to have somewhat of a steep learning curve, but that’s just me. Again, I just don’t speak “French” that well.
However, imagine if you had a French translator. Someone who can bridge that gap between you, and the oh so lovely French folks, without any loss in the quality of the communication. In fact, this translator not only spoke French, but could speak about every other language known to man, well, maybe except one (*cough* Blackberry *cough*). You could effectively use your translator anywhere in the world.
In the hybrid/cross-platform mobile development realm, I consider this “translator” to be Xamarin. As it says on their website,
“Xamarin is unique in this space by offering a single language – C#, class library, and runtime that works across all three mobile platforms of iOS, Android, and Windows Phone (Windows Phone’s indigenous language is already C#), while still compiling native (non-interpreted) applications that are performant enough even for demanding games.”
It is a very powerful platform to say the least. A game changer if you ask me. Xamarin not only combines the powerful of all 3 platforms, but it adds its own features on top. Some of which include:
– Bindings for the Indigenous SDK: Xamarin provides strongly-typed binding for nearly the whole underlying platform SDKs in both iOS and Android. Some advantages to this include type checking during development, and compilation.
– Invoking native libraries – This gives you the power to use existing iOS and Android libraries written in Objective-C, Java or C/C++. Xamarin just released a tool, Objective Sharpie, which takes much of the manual work of translating Objective C APIs into binding definitions that are consumed by Xamarin’s binding tools.
– Modern Language features – Xamarin applications are written in C#, allowing developers to take advantage of strengths such as Dynamic Language features, and Functional Constructs such as LINQ, Lambdas, Generics, etc. Many of these features are significant improvements over Objective-C and Java.
– Use of Base Class Library (BCL) – Xamarin utilizes the .NET BCL, which is a collection of many classes that provide a comprehensive set of features like XML, Database, Serialization, Networking, and IO support, to name a few.
– Amazing Development Environment – Formerly called MonoDevelop, Xamarin has revolutionized their Integrated Development Environment (IDE), now called Xamarin Studio. It also provides deep integration with the Visual Studio IDE, allowing the .NET developer’s favorite IDE to be used for development as well.
– Mobile Cross-platform support – With the support coverage across all three platforms (iOS, Android, Windows Phone) provided by Xamarin, developers can expect to share up to 90% of their code. During my last project, we estimated a code sharing rate of about 80%, saving a ton of time and effort in development and time to market. We were able to release two apps for both the iPhone and iPad, in 100 days (from Concept to Store).
Over the next few weeks/months, I’ll be sharing many of my experiences using this incredible framework, and engage with the dev community, while learning from you all as well.
Happy Xamarin trails!