Channels ▼
RSS

Database

Xamarin 2.0 Review


Android Development

Because Google's Android's SDK runs on Windows, Mac, and Linux, Xamarin Studio Android applications can be deployed and debugged from either the Windows or Mac platform. Users of the Business edition will also benefit from the Visual Studio integration, allowing Android applications to be coded and managed entirely within the Visual Studio IDE (Figure 4). While the Xamarin Studio IDE offers an adequate coding interface (and one that is preferred if working with a team of developers using Macs and Windows computers), Xamarin's IDE has a long way to go before it can surpass the polish of the Visual Studio environment. One the other hand, if you're developing Xamarin Android applications on a Mac, there's no integration (and probably never will be) with Apple's Xcode environment. As such, the Xamarin Studio IDE is where you'll spend your time when developing Mono-based applications for either iOS or Android applications.

Developing Xamarin android app in Visual Studio
Figure 4: Developing a Xamarin Android application within Visual Studio.

Unlike iOS Mono applications, Xamarin Android programs can have the Mono runtime library either shared or statically linked into your applications. If you're planning on deploying several Xamarin Android apps to the same device (say a sales automation mobile suite in a controlled corporate environment), it makes sense to install the runtime separately. But if the application is going to be sold as a standalone item in the Google Play store, statically linking the runtime is the best way to go. Of course, this will add considerable bulk to your Android application.

Mac Development

An added benefit of Xamarin 2.0 is that developers can create native look and feel Apple OSX applications with the inclusion of Xamarin.Mac. For more about Xamarin.Mac, read my earlier review.

All Together Now

The Xamarin 2.0 development experience had the same impact on me as seeing Visual Studio bring Visual Basic, Visual C++ and .NET development all under the same roof. It's an empowering feeling to find that you can use the years of C# coding skills to create native applications on the two most popular mobile operating system platforms today. Windows developers who have amassed a collection of powerful Visual Studio plug-ins have the added bonus of using that investment toward mobile application development. While it does take some forethought to abstract the presentation layer elements from the code, doing so goes a long way toward reuse when developing cross-platform Xamarin Android, iOS or Mac applications. While I'd still like to see Xamarin tackle the immensely challenging problem of creating a GUI builder that can generate code targeting native widgets for all platforms, smart use of programmatic instantiation of GUI elements is one way to maneuver around this limitation.

Component Store

One important aspect of this release is the availability of Xamarin's Component Store (Figure 5). Recognizing how many of their customers were reinventing the wheel for data and visual element interactions, Xamarin now offers developers the ability to not only download curated libraries and packages that the company has vetted for quality, but also participate in and perhaps even making a little money at Xamarin component development.

Developing Xamarin android app in Visual Studio
Figure 5: The Xamarin Component Store.

While the store has somewhat limited inventory at the moment, the components they do have (both free and commercial) are surprisingly good. Some even have links to the source code in case your particular programming itch needs a little more scratching. There are also some useful components that Xamarin will no doubt be including as part of their base product in future releases. A few of my favorite free Xamarin components are Xamarin.Mobile, James Newton-King's Json.NET, and Redth's ZXing.Net.Mobile. And speaking of the ZXing.Net.Mobile component (that works on iOS, Android, and Windows Phone), take a look at how easy it is to implement barcode scanning (1D, 2D, QRcode, and so on in either landscape or portrait orientation) in a Xamarin application:

var options = new ZXing.Mobile.MobileBarcodeScanningOptions();
  options.PossibleFormats = new List<ZXing.BarcodeFormat>() 
   ZXing.BarcodeFormat.Ean8, ZXing.BarcodeFormat.Ean13
};

var scanner = new ZXing.Mobile.MobileBarcodeScanner();
  scanner.Scan(options).ContinueWith(t => { //Handle results });

Compare these four lines of code with the arduous task of not only writing your own barcode library for iOS or Android, and then writing the Objective-C or Java code to call upon that library. In my mind, there's no comparison.

Conclusion

Xamarin 2.0 is a very good product, especially valuable to C# developers. The speed and agility gained by using the collection of technologies that Xamarin has bundled into this release is stunning. In addition, the Xamarin components market is a good move and one that will surely gain traction over time. (We may even see component offerings from big name vendors like Infragistics and Component One in Xamarin's marketplace one day.) Even less glamorous but important areas of the product such as documentation, installation, configuration are considerably improved from their earlier standalone products. Xamarin 2.0 has brought together a powerful platform that has considerable market potential as they lead the way in cross-platform development in the post-PC era.


Mike Riley is a blogger for Dr. Dobb's and has been a judge for the Jolt Awards for more than 15 years.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video