This article walks through the installation steps and configuration details required to install Xamarin.Android. By the end of this article, we will have a working Xamarin.Android installation integrated into Xamarin Studio, and we’ll be ready to start building our first Xamarin.Android application.
The Xamarin.Android installer will automatically detect, download, and install any components required for completing the installation. This tutorial examines the installation and configuration steps required to install the Xamarin.Android platform and to get our development environment set up, including:
- Downloading the Installer
- Running the Installer
- Configuring our IDE
- Configuring any Additional Emulators
Downloading the Xamarin Installer
Your first step is to download the Xamarin unified installer, which can be found at http://www.xamarin.com/download:
If you’ve purchased Xamarin.Android, follow the download instructions in the e-mail you received with your purchase.
Running the Xamarin Installer
Open the installer *.dmg file, and run the installer by double-clicking it:
Step 1- Identifying the Required Components
The first step required by the installer is to inspect the system to determine which, if any, required components are missing and need to be downloaded and installed:
The Xamarin installer should automatically inherit from the system network proxy settings for the active network interface. To manually configure the proxy open Application > System Preferences.app and select the Network icon. Then select the appropriate network interface and click the Advanced button. Finally, set the configuration values in the Proxies tab:
Step 2 - Installing the Components
After identifying missing components, the Xamarin installer downloads and executes the installers for the platform dependencies, as shown in this dialog:
Be aware that during this part of the installation, you may be prompted to elevate the permissions necessary for individual components that are needed to complete installation.
Step 4 - Completing the Installation
Step 5 - Activation
As you start developing, you will be asked to activate your installation. You will see a popover that looks like this:
Use the first option to start a 30-day free trial of Xamarin Business Edition. If you're ready to purchase, choose the second option to be redirected to the Xamarin store and checkout.
If you've already purchased your Xamarin products, click on "Log in with a Xamarin Account". This will launch a browser window where you can enter your Xamarin account credentials (email and password).
Upon successful activation, you can return to Xamarin Studio. XS will notify you that the activation has been completed.
NOTE: If you are running Starter Edition, you may see the activation popover with an added note saying that the project you are trying to compile is too large. At this point will need to either purchase a license or begin a trial if you want to build your project. If you've purchased an Indie or Business license and get this notification, try logging in with your Xamarin account again, and contact support is the problem persists.
Creating an Application
Now that we’ve installed the components, we can launch Xamarin Studio and create a new solution.
Select Start New Solution from the Xamarin Studio Welcome Screen and select Xamarin.Android > Xamarin.Android Application in the New Solution dialog. Enter an application name and click OK.
Once the Xamarin.Android solution is loaded in Xamarin Studio, we can run the application in one of the emulators that Xamarin.Android pre-creates during installation, shown below in the Android Virtual Device Manager.
We’ll discuss how to use the Android Virtual Device Manager to create additional emulators in the next section.
Configuring Additional Android
Emulators You can run the Android emulator in a variety of configurations to simulate different devices. Each one of these configurations is created as a Virtual Device. By default, the Xamarin.Android installer will create a virtual device for each of the Android platforms registered by the installer. However, we can create our own custom virtual device configuration.
Virtual devices are configured via the Android Virtual Device (AVD) Manager. The AVD Manager can either be launched from the Android SDK Manager, or directly from Xamarin Studio (if we’re using it).
Launching the AVD Manager from Xamarin Studio
In Xamarin Studio, the AVD Manager can be launched directly by selecting Tools > Open AVD Manager from the menu bar:
Creating a new Virtual Device
Once the AVD Manager is open, we can create a new virtual device by clicking New...
This should open the Create new Android Virtual Device dialog and allow us to configure our device by using this dialog:
Once we’re finished configuring the device, we can select Create AVD. We can then see that the device was created successfully with the hardware configuration options we specified by checking the dialog shown below:
That’s it! Now we’re all set up to use Xamarin.Android to create Android applications!
In this article, we examined how to set up and install the Xamarin.Android platform on Mac. We also looked at some different ways to configure our platform installation in Xamarin Studio and in Visual Studio. And we showed you how to use the Android Virtual Device Manager to define your Android SDK Emulator configurations. In the next tutorial, we’ll use Xamarin.Android to create our first Android application.