Installing Xamarin.Android on Windows
- PDF for offline use
- Related Articles:
Let us know how you feel about this
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.
- Create an Application
This guide explains how to get Xamarin.Android up and running in Visual Studio. Because Xamarin is now included with all editions of Visual Studio at no extra cost (and does not require a separate license), these steps mainly entail using 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 the following sections, 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.
The following are required for installing Xamarin.Android on Windows:
Windows 7 or higher.
Visual Studio 2015 or 2017 (Community, Professional, or Enterprise) or a non-Express edition of Visual Studio 2013 Update 2.
Xamarin for Visual Studio.
Xamarin.Android cannot be used with Express editions of Visual Studio due to lack of plug-in support.
Xamarin can be installed as part of your Visual Studio 2017 installation. To achieve this, use the following steps:
Download Visual Studio Community, Visual Studio Professional, or Visual Studio Enterprise from the Visual Studio page (download links are provided at the bottom of that page). Xamarin is supported by all editions of Visual Studio 2017.
Double-click the downloaded package to start installation.
Select the Mobile development with .NET workload from the installation screen:
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):
When you are ready to begin the Visual Studio installation, click the Install button in the lower left-hand corner:
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:
When Visual Studio installation has completed, click the Launch button to start Visual Studio:
Earlier versions of Visual Studio
To install Xamarin.Android on Visual Studio 2015 or Visual Studio 2013 Update 2, use the following steps:
Download the Visual Studio Installer:
Double-click the downloaded package to run the installer. If you already have Visual Studio, the installer will add Xamarin to your existing installation.
The installer will inspect your computer to determine which, if any, components need to be installed. When it prompts for which workloads to install, select the Mobile development with .NET workload and continue with the steps described above for Visual Studio 2017.
For more information about installing Xamarin.Android on earlier versions of Visual Studio, see the Visual Studio and Xamarin Setup and Install page.
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:
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:
By default, Visual Studio installs 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.
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.
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:
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:
That's it! Now you are ready to use Xamarin.Android to create Android applications!
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.