Xamarin - Documentation

Android

change platform

  1. Xamarin
  2. Android
  3. Getting Started
  4. Installation
  5. Installation for Mac

Installation for Mac

Installing Mono for Android on OSX

Brief

This article walks through the installation steps and configuration details required to install Mono for Android. By the end of this article, we will have a working Mono for Android installation integrated into MonoDevelop, and we’ll be ready to start building our first Mono for Android application.

Overview

The Mono for 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 Mono for 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 Mono for Android Installer

Your first step is to download the Mono for Android Mac OSX installer, which can be found at http://android.xamarin.com/DownloadTrialXamarin:

DownloadTrial.png

If you’ve purchased Mono for Android, follow the download instructions in the e-mail you received with your purchase.

Running the Mono for Android Installer

To run the installer, double-click the dmg to mount it. Then, simply double-click it the installer.

Installer.png

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:

Prerequisites.png

Step 2 – Accept the License

Before the installation can continue, you need to accept the license agreement.

license.png

Step 3 – Installing the Components

After identifying missing components, the Mono for Android installer downloads and executes the installers for the platform dependencies, as shown in this dialog:

InstallInProgress.png

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

Once we’ve reached this step, we’re ready to begin developing a Mono for Android application. Select Launch MonoDevelop and continue on to the final step:

InstallSucceeded.png

Step 5 – Creating an Application

Now that we’ve installed the components, we can launch MonoDevelop and create a new solution.

Select Start New Solution from the MonoDevelop Welcome Screen and select Mono for Android > Mono for Android Application in the New Solution dialog. Enter an application name and click OK.

NewSolution.png

Once the Mono for Android solution is loaded in MonoDevelop, we can run the application in one of the emulators that Mono for Android pre-creates during installation, shown below in the Android Virtual Device Manager.

PreCreatedEmulators.png

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 Mono for 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 MonoDevelop (if we’re using it).

Launching the AVD Manager from MonoDevelop

In MonoDevelop, the AVD Manager can be launched directly by selecting Tools > Open AVD Manager from the menu bar:

OpenAVDMgr.png

Creating a new Virtual Device

Once the AVD Manager is open, we can create a new virtual device by clicking New…

NewEmulator.png

This should open the Create new Android Virtual Device dialog and allow us to configure our device by using this dialog:

NewEmulatorDialog.png

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:

EmulatorCreated.png

That’s it! Now we’re all set up to use Mono for Android to create Android applications!

Summary

In this article, we examined how to set up and install the Mono for Android platform on Mac. We also looked at some different ways to configure our platform installation in MonoDevelop 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 Mono for Android to create our first Android application.