Xamarin Mobile Application Development for Android(Second Edition)
上QQ阅读APP看书,第一时间看更新

Why Xamarin.Android?

Before we take a dive into the architecture of Xamarin.Android, let's first discuss the question of why Xamarin.Android is our choice. Like any significant platform decision, one size does not fit all, and there are a number of things that should be considered. The following two lists identify some of the key benefits and drawbacks of using Xamarin.Android.

The benefits of using Xamarin.Android

  • It leverages existing C# and .NET skills: Developers invest a great deal of time and energy in mastering the many features of the C# language and the effective use of the .NET framework. Yes, Java and all object-oriented languages have many similarities, but there is a real cost associated with going from being proficient in C# and .NET to making the same claim in Java. Individuals and groups that have made a significant investment in C# and .NET and need to develop Android apps would be well served to at least consider Xamarin.Android.
  • It can be reused in cross-platform development: While Xamarin will not allow you to build a single app that can be deployed to Android, iOS, and Windows, it does give you the capability to reuse large portions of your code base across all of these platforms. In general, the user interface code and the code that deals with the device capabilities tend to be written for each platform, while things such as service client logic, client-side validation, data caching, and client-side data storage can potentially be shared across multiple platforms. This can save a significant amount of time and cost.

The drawbacks of using Xamarin.Android

  • The licensing requirement: Xamarin.Android as well as Xamarin.iOS and Xamarin.Mac are all commercial tools and must be licensed, so there is a tangible cost of entry. Check the Xamarin website for current pricing.
  • Waiting for updates: There is some lag time between a new release of the Android platform and the corresponding release of Xamarin.Android. However, Xamarin is aiming for zero day support for the new version of Android and iOS.
  • Distribution size: There are a number of runtime libraries that must be distributed with a Xamarin.Android application. We will discuss the actual size and strategies for minimizing the distribution size in the last chapter.

While the list of drawbacks may seem extensive; in most cases, the impact of each can be minimized. If you are a group or individual that places a high value on the benefits, you should seriously consider Xamarin.Android.