Often, when developing a mobile app one wants to target iOS as well as Android (+ maybe MS’ OS).
Now, this basically means developing the app from scratch and consequently maintaining it at least twice on different platforms, written in different languages (Objective-C and Java, that is), using different sets of tools etc.
Cumbersome and potentially error-prone. Well, there’s a viable alternative:
With Xamarin one can write mobile apps targetting iOS and Android in C# using .NET (and native) libraries, sharing code (business logic, data & web service layers, utilities, …) while creating fully native UIs built on each platform’s own SDKs, providing access to all respective device capabilities.
In addition to that, there’s for example MonoTouch.Dialog making it easier and more fun to create table-based iOS UIs and for Android there’s a useful visual UI design tool within the MonoDevelop IDE. Plus, there’s Xamarin.Mobile aimed at exposing an unified API facade for accessing common device features. All interesting stuff when used sensibly.
Here’s some demo code (which is loosely based on samples from the recommendable book “Mobile Development with C#”) showing how mentioned shared layers could benefit:
1 2 3 4 5 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
1 2 3 4 5 6
And with .NET 4.5’s new async features landing in Monoland soon, related code will get even more convenient to write and handle.
Pretty neat, IMHO. What do you think?