Introducing the Xamarin Mobile API

With both MonoTouch and Mono for Android we have chosen to expose the native platform APIs to C# developer so they can take advantage of all the unique features that each platform has to offer. This means that Android developers can create applications that interact with the system in the same ways that a Java app would do, while taking advantage of C# and the .NET class libraries. On iOS this means that developers can consume iOS-specific features like CoreAnimation, CoreImage and program directly against the UIKit API to get the most out of the native platform:

Current Stack of MonoTouch APIs

The above approach allows developers to get the most out of the underlying platform. For this to work beyond a single platform, developers normally split their code along the lines of the components that must deal with the platform specific APIs, mostly the UI elements, and the components that only require the .NET Base Class Libraries (BCL). Usually the core application or the business logic goes into a reusable library and then multiple front-ends are created, one for iPhone, one for Android and even ASP.NET and WP7 UIs can be built on top of it.

But often developers find that many other services that are common across mobile platforms are not exposed by the .NET BCL. This makes the effort of sharing code more cumbersome than it should be. Developers resort to creating their own platform abstractions, or designing pluggable architectures just to get access to the system address book, the phone’s GPS, the compass, the accelerometer, the notification service or the system calendar.

To solve this problem, we are introducing Xamarin.Mobile. This is a library that runs on iPhone, Android and Windows Phone 7 which abstracts the underlying functionality and exposes a common API that developers can built against:

Xamarin Mobile Stack

Today we are launching a preview of the Xamarin.Mobile library. This first version contains our cross platform location APIs for both Mono for Android and MonoTouch (Windows Phone 7 will be added in an upcoming release). You can download the binaries here.

We are running a survey to better understand which are the most important APIs and platforms for our community.

If you want to send us feedback or report bugs, please File a Bug Report in our bug tracking system.

Posted on November 22, 2011