Windows Installation

Installing Xamarin.Android on Windows

PDF for offline use
Related Articles:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-05

This guide describes the steps for installing Xamarin.Android for Visual Studio on Windows, and it explains how to configure Xamarin.Android for building your first Xamarin.Android application.

Overview

Because Xamarin is now included with all editions of Visual Studio at no extra cost and does not require a separate license, you can use the Visual Studio installer to download and install Xamarin.Android tools. (The manual installation and licensing steps that were required for earlier versions of Xamarin.Android are no longer necessary.) In this guide, you will learn the following:

  • How to install Xamarin.Android for use with Visual Studio on Windows.

  • How to configure custom locations for the Java Development Kit, Android SDK, and Android NDK.

  • How to launch the Android SDK Manager to download and install additional Android SDK components.

  • How to prepare an Android device or emulator for debugging and testing.

  • How to create your first Xamarin.Android app project.

By the end of this guide, you will have a working Xamarin.Android installation integrated into Visual Studio, and you will be ready to start building your first Xamarin.Android application.

Requirements

The following are required for installing Xamarin.Android on Windows:

  1. Windows 7 or higher.

  2. Visual Studio 2015 or 2017 (Community, Professional, or Enterprise) or a non-Express edition of Visual Studio 2013 Update 2.

  3. Xamarin for Visual Studio.

Note that Xamarin.Android cannot be used with Express editions of Visual Studio due to lack of plug-in support.

For more information about the pre-requisites for installing and using Xamarin, see System Requirements.

Installation

Xamarin can be installed as part of a new Visual Studio installation. To achieve this, use the following steps:

  1. Download Visual Studio Community, Visual Studio Professional, or Visual Studio Enterprise from the Visual Studio page (download links are provided at the bottom).

  2. Double-click the downloaded package to start installation.

  3. Select the Mobile development with .NET workload from the installation screen:

    Mobile development with .NET selection on the Workloads screen

  4. While Mobile development with .NET is selected, have a look at the Summary panel on the right. Here, you can deselect mobile development options that you do not want to install. By default, all options shown in the following screenshot are installed (Xamarin Workbooks, Xamarin Profiler, Xamarin Remoted Simulator, Android NDK, Android SDK, Java SE Development Kit, Google Android Emulator, F# support, and Intel HAXM):

    Summary panel listing Xamarin options to install

  5. When you are ready to begin Visual Studio installation, click the Install button in the lower left-hand corner:

    Location of installation button

    Depending on which edition of Visual Studio you are installing, the installation process can take a long time to complete. You can use the progress bars to monitor the installation:

    Example screenshot of progress bars during installation

  6. When Visual Studio installation has completed, click the Launch button to start Visual Studio:

    Location of Launch button

Adding Xamarin to Visual Studio 2017

If Visual Studio 2017 is already installed, you can add Xamarin by re-rerunning the Visual Studio installer to modify workloads (see Modify Visual Studio for details). Next, follow the steps listed above to install Xamarin.

For more information about downloading and installing Visual Studio 2017, see Install Visual Studio 2017.

Adding Xamarin to Visual Studio 2015 or 2013

To add Xamarin.Android to an existing installation of Visual Studio 2015 or Visual Studio 2013 Update 2, use the following steps:

  1. Right-click the Windows Start button and select Programs and Features.

  2. Right-click Microsoft Visual Studio and click Change.

  3. When the Visual Studio Installer dialog appears, click the Modify button.

  4. In the Features tab, scroll down to Cross Platform Mobile Development. Click the checkbox next to C#/.NET (Xamarin):

    Adding C#/.NET Xamarin to Visual Studio 2015

  5. Click the UPDATE button to add Xamarin to Visual Studio.

Verifying Installation

In Visual Studio 2017, you can verify that Xamarin is installed by clicking the Help menu. If Xamarin is installed, you should see a Xamarin menu item as shown in this screenshot:

Xamarin menu item displayed on the Help menu

If you are using an earlier versions of Visual Studio, you can click Help > About Microsoft Visual Studio and scroll through the list of installed products to see if Xamarin is installed:

Visual Studio installed products screen

For more information about locating version information, see Where can I find my version information and logs?

Configuration

Xamarin.Android uses the Java JDK and the Android SDK to build apps. During installation, the Visual Studio installer places these tools in their default locations and configures the development environment with the appropriate path configuration. You can view and change these locations by clicking Tools > Options > Xamarin > Android Settings:

Screenshot of Xamarin Android settings dialog

For most users these default locations will work without further changes. However, you may wish to configure Visual Studio with custom locations for these tools (for example, if you have installed the Java JDK, Android SDK, or NDK in a different location). Click Change next to a path that you want to change, then navigate to the new location.

Android SDK Manager

Android uses multiple Android API level settings to determine your app's compatibility across the various versions of Android (for more information about Android API levels, see Understanding Android API Levels). Depending on what Android API level(s) you want to target, you may need to download and install additional Android SDK components. In addition, you may need to install optional tools and emulator images provided in the Android SDK. To do this, use the Android SDK Manager. You can launch the Android SDK Manager by clicking Tools > Android > Android SDK Manager:

How to launch the Android SDK Manager

By default, Visual Studio installs the Google Android SDK Manager:

Screenshot example of the Google Android SDK Manager

You can use the Google Android SDK Manager to install versions of the Android SDK Tools package up to version 25.2.3. However, if you need to use a later version of the Android SDK Tools package, you must install the Xamarin Android SDK Manager plugin for Visual Studio (available from the Visual Studio Marketplace). This is necessary because Google's standalone SDK Manager was deprecated in version 25.2.3 of the Android SDK Tools package.

For more information about using the Xamarin Android SDK Manager, see Using the Xamarin Android SDK Manager.

Android Emulator

If you don't have a physical Android device to use for testing, you can use an Android emulator to test your app. For more information about configuring and using the Google Android emulator, see Android SDK Emulator.

The Google Android emulator uses Intel's HAXM (Hardware Accelerated Execution Manager), which can conflict with the virtualization technologies used by other emulators. The three main virtualization technologies are:

  • Hyper-V (used by the Visual Studio Emulator for Android and the Windows Phone emulator)

  • Virtual Box (used by Genymotion)

  • Intel HAXM (used by the Google Android SDK emulator)

Because a development computer's CPU can support only one virtualization technology at a time, it's best to have only one in use on a development computer.

Android Device

If you have a physical Android device to use for testing, this is a good time to set it up for development use. See Set Up Device for Development to configure your Android device for development, then connect it to your computer for running and debugging Xamarin.Android applications.

Create an Application

Now that you have installed Xamarin.Android, you can launch Visual Studio create a new project. Click File > New > Project to begin creating your app:

How to create a new project

In the New Project dialog, select Android under Templates and click Blank App (Android) in the right pane. Enter a name for your app (in the screenshot below, the app is called MyApp), then click OK:

Screenshot of New Project dialog, creating a blank Android app

That's it! Now you are ready to use Xamarin.Android to create Android applications!

Summary

In this article, you learned how to set up and install the Xamarin.Android platform on Windows, how to (optionally) configure Visual Studio with custom Java JDK and Android SDK installation locations, how to launch the SDK Manager to install additional Android SDK components, how to setup an Android device or emulator, and how to start building your first application.

The next step is to have a look at the Hello, Android tutorials to learn how to create a working Xamarin.Android app.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.