Xamarin Brings Consumer Mobile Development to Visual Studio


Learn how to use Xamarin to build native iOS and Android apps using your .NET Framework and C # skills. We focus on integrating Xamarin with Visual Studio.

Image: Xamarin

A mobile device is the computer of many people. Look around and watch the kids tweet and the grandparents update their Facebook status. Apple apparently established the mobile market with its iPhone, but the Android platform has burst onto the scene and gained market share.

While building mobile apps with web standards (HTML5, CSS, and JavaScript) is popular, native apps are often seen as the best option when building whole apps, leaving .NET developers on the outside. . Xamarin changes that by providing a way to build native iOS and Android apps using your C # and .NET Framework skills.

Xamarin history and pricing

Xamarin has been on the .NET scene for a few years, although it got its start over a decade ago with the open source Mono project. Over the years, Mono changed hands and finally found its place at the heart of the Xamarin product line. Mono is still open source and available for free, but Xamarin with Visual Studio support is not.

You can use Xamarin Studio for free, but support for Visual Studio starts with the Business edition (currently $ 999 / year); his shop provides all the information. There is free training and discounts for MSDN Subscribers. It will be interesting to see how Xamarin is offered if Microsoft ever decides to buy the company.


A 30 day trial version is available for download from the Xamarin site. The following components are installed with Xamarin:

  • Xamarin. ios allows you to create native iOS apps.
  • Xamarin. Android allows you to create native Android apps.
  • Xamarin.Mac allows you to create OS X applications in C #.
  • Xamarin.Studio is the standalone Xamarin IDE. Figure A the poster opened with the New solution option selected. The marriage to Microsoft continues, as the latest version of the Xamarin IDE includes support for NuGet.
  • Visual Studio Integration: A Visual Studio add-in is installed to facilitate the development of Xamarin projects in the Visual Studio IDE. Number B shows new Xamarin-centric apps available once installed.
  • SDK: The necessary SDKs are installed for Android, Apple and Java.

Figure A

The stand-alone Xamarin IDE can be used without Visual Studio.

Number B

Xamarin includes new types of mobile Visual Studio projects.

With Xamarin installed, you are one step closer to building Android and / or iOS apps with C # through Visual Studio. You will need a Xamarin account to create and run these projects in Visual Studio. You will be presented with the window shown in Figure C when you try to run code. Registration is free.

Once registration is complete (or you log in using an existing account), you are presented with the window in Number D to decide if you want to buy the product or have a try. Your Xamarin account options are available in Visual Studio (as shown in Encrypted), so that the settings can be changed after the initial setup.

Figure C

You must create an account with Xamarin to fully use the options of Visual Studio.

Number D

Once you have signed up with Xamarin, you must choose to have a try or pay for the product.


Xamarin account settings are available through the Tools menu in Visual Studio.

Xamarin Drive Test

The sample solutions available on the Xamarin site are a good place to start learning how to use the platform. I chose the Xamarin store the app, which is available as a zip file (you can also get a free t-shirt if you run the app). Once downloaded, you can open in Xamarin and browse the code to see how it can be organized. Figure F shows the solution open in Visual Studio 2013 Ultimate.

The solution shown in Figure F illustrates one of the key features of using Xamarin: a common or shared codebase with specific code for each platform. The solution uses shared data classes (Color.cs, FileCache.cs, etc.) as well as shared helper and template classes. While you still need to create native code specific for the target platforms, the ability to share code will reduce maintenance and, hopefully, development. The full details of code and building an app go beyond this article, but Number G shows one of the Android emulators (there is one for each platform version) launched from within Visual Studio – an easy-to-use approach to testing an app.

Figure F

Browse the Xamarin Store sample app in Visual Studio.

Number G

Android emulator launched from Visual Studio.

First impressions

I had heard and read a lot of great things about Xamarin, so I was happy to finally be able to use it. The installation process takes a long time, but again, the installations of the last two versions of Visual Studio took a long time. I have configured it on Windows 7 and Windows 8.1 machines. Both environments were slow (Visual Studio always seems to take a while to launch). I didn’t see any additional issues in Windows 8.1, but the Windows 7 environment crashed several times when trying to work with the source code.

Given the issues with Windows 7, I ended up sticking with Windows 8.1. The auxiliary tools (SDKs and emulators) were problem free. One caveat with development for iOS (and Mac) is the availability of a Mac computer to build and host the iOS solution; it requires additional configuration on the Mac machine (installing / configuring XCode and Xamarin), which was not difficult, but it does mean that you need an additional machine.

Will Xamarin be standard for Microsoft?

I knew there were changes on the horizon with Xamarin’s strong presence at TechEd 2013. A partnership between Microsoft and Xamarin was announced in late 2013, so I don’t think anyone will be surprised if Microsoft ultimately buys Xamarin.

The integration with Visual Studio is great because it allows developers to continue with an environment they are comfortable in, so they can focus on learning the ins and outs of mobile development without worrying about anything. ‘a new IDE. It looks like this will be the standard for mobile development with Microsoft tools.

Leave A Reply

Your email address will not be published.