Technology Lab —

Xamarin 2.0 reviewed: iOS development comes to Visual Studio

Write your iOS software from within Windows. Yes, really.

Xamarin Studio

All is not lost, however, for developers without Visual Studio. Xamarin's own IDE is a good alternative. The company says it took MonoDevelop "back to the drawing board." The result is Xamarin Studio, an open source C# IDE that runs on both OS X and Windows. It supports iOS and Android development when run on OS X and Android development in Windows.

Xamarin Studio is built around the same solution and project model as Visual Studio, and its layout and general approach to project organization will be immediately familiar to anyone who's used Microsoft's IDE. It has all the features one would expect of a modern development environment: syntax highlighting, autocompletion, refactoring, an integrated debugger, and so on. Support for both git and Subversion version control systems is integrated.

Enlarge/ Xamarin Studio does all the things you'd expect an IDE to do.

Overall Xamarin Studio is a serviceable, effective environment, albeit a simpler one than Visual Studio. It doesn't have all Visual Studio's bells and whistles, but it isn't going to leave anyone feeling hamstrung by their tools.

However, I did find a few rough points in sharing code between Xamarin Studio for OS X, Xamarin Studio for Windows, and Visual Studio. The C# project files have a number of different types, depending on what the target is. There are generic C# projects that contain platform-independent, shared code, and there are platform-specific ones for iOS, Android, and even WinRT or Windows Phone.

Not all project types are understood by Xamarin Studio. The Windows version, for example, only understands the generic ones and the Android ones. If you load a project containing an iOS-specific project, you get an ugly error message and the iOS project fails to load (though the rest of the solution is OK). Similarly, if you load a solution with WinRT projects, you'll see an error message.

While I understand the reasons for this technically, I think Xamarin should have provided some kind of barebones support. At the very least, every version of Xamarin Studio should recognize the major different project types (even if it can't build them) so that a solution that targets multiple platforms can load without errors and allow one to see the source files belonging to every project.

Component Store

One of the mainstays of software development is the re-usable library. Windows and .NET developers in particular have long made extensive use of third-party components built using Microsoft's COM and .NET technology for tasks such as charting and report generation. A thriving ecosystem of component developers exists.

Xamarin wants to bring this ecosystem to the Xamarin platform, and its Component Store is the way it has chosen to do so. It contains a mix of free and commercial components. Presently, most components are for both Android and iOS, with a few also supporting Windows.

The Component Store is nicely integrated into Xamarin Studio and Visual Studio. It lists the components your project is using and new components can be added with a couple of clicks. The component documentation appears to be solid, with clear examples of how to integrate each component with both iOS and Android. Components can include sample projects to demonstrate their usage.

Assessing the Component Store at this point is a little difficult. The basic system works well enough, but the key test is whether it can grow to include a wide range of components. The component selection is currently quite limited (not surprising, given the age of the store) but Xamarin says well-known component companies such as Infragistics will be producing components.

In a related vein, Xamarin is providing a selection of pre-built applications to give developers the barebones frameworks for their own projects. These are tailored to line-of-business applications, one of Xamarin's core markets. Currently there are two: an employee directory app aimed at phones and an app for field service agents (containing an appointment list, mapping, signature pads for customers to sign off on work, and so on) aimed at tablets.

These pre-built apps are licensed with the permissive Apache 2.0 license, so these can be safely used by developers of all kinds to get their apps up and running. The apps include dummy versions of things like authentication logic for devs to plumb in themselves.

New product, new pricing

For the new version, Xamarin has introduced a new pricing scheme. The most exciting aspect of this is there's now a no-cost tier, the starter edition. This is designed for individual developers who want to get started with the Xamarin platform. Starter edition doesn't include the Visual Studio integration and is pretty constrained. In particular, it limits the compiled size of an application to a maximum of 32kB of IL code. It also doesn't allow use of P/Invoke, a .NET feature that lets C# programs call native code libraries.

Moving up is the Indie edition at $299 per year. This lifts the size and P/Invoke limits but is otherwise the same as Starter edition.

The mainstream version is Business edition at $999 per year. This is licensed for both corporate developers and individuals. It includes Visual Studio support, additional build and deployment options, SQL Server access, and tech support via e-mail from Xamarin.

The top-of-the-range version is Enterprise edition at $1,899 per year. This has everything Business edition has, plus $500 worth of components, a one-business-day response to support queries, and one hour of initiation from Xamarin engineers.

The new free tier makes Xamarin much more approachable to small developers and greatly increases the chance that they'll get hooked on the Xamarin platform.

A compelling mix of cross-platform development and rich tooling

The Xamarin platform is unique. iOS, with its Objective-C development, and Android, with its Java/C/C++ development, are wildly different platforms. This poses a great challenge for developers who want to share the core logic of their applications between apps. There are essentially only two solutions to this conundrum. The first is using HTML and JavaScript (using software such as PhoneGap, or the Web). The second is Xamarin. HTML and JavaScript work, but they mean giving up rich tooling, the safety of static compilation, easy access to native libraries and platform-specific features, and typically, performance. Xamarin enables cross-platform development without giving up these things. It's a best-of-both-worlds solution.

But it's more than that. Xamarin is a great platform even if you're not bothered about cross-platform development. This is particularly the case on iOS. With C# and Xamarin, you pick up a lot of creature comforts (such as simpler memory management and a cleaner language) that are themselves enough to give Objective-C developers pause for thought.

Xamarin 2.0 isn't complete. The team at Xamarin knows that it wants to add more features and make the platform better. But it's a compelling, usable, desirable platform right now. Future developments will only make it better.