An Alternative Approach
What I am going to propose is an alternative approach where you can leverage the power of the .NET Framework, along with the powerful C# language, across all three platforms. While this may sound similar to “write once, run anywhere,” the key difference is that C# and the Base Class Libraries are used as a universal language and library where the device-specific and user interface-specific elements are not abstracted, but are instead exposed to developers. This means that developers build native applications using three different user interface programming models, one for each platform, while using C# across the board.
As mentioned earlier, .NET is exposed natively on Windows Phone, so there’s no friction there. However, we know that on both iOS and Android it is not, so how can we make this work? To help bridge this gap, a company named Xamarin has created two products, MonoTouch and Mono for Android. We will explore these products in more depth in later chapters, but the elevator pitch is that they allow for writing native applications in C# (see Table 1-2), providing bindings to the platform’s native libraries and toolkits so that you’re targeting the same classes you would in Objective-C for iOS or Java for Android. Because you’re working against the platform’s native user interface toolkits, you don’t need to worry about how to make your application look and feel native to the platform, since it already is.
Table 1-2. Native platform languages with Mono ...