To simplify the development of these features across multiple platforms, Xamarin has developed a library called Xamarin.Mobile. It delivers a single API for accessing the contacts, GPS location, cardinal direction, camera, and photo library for iOS, Android, and even Windows platforms. It also takes advantage of Task Parallel Libraries (TPL) to deliver a modern C# API that will make developers more productive than what their native alternatives would. This gives you the ability to write nice, clean, asynchronous code using the async
and await
keywords in C#. You can also reuse the same code in iOS and Android, minus a few differences that are required by the Android platform.
To install Xamarin.Mobile, open the Xamarin Component Store in Xamarin Studio and add the Xamarin.Mobile component to a project, as shown in the following screenshot; you're going to be using these features (of the component):
Before we dig further into using Xamarin.Mobile, let's review the...