Installing Xamarin.Android on Windows
- PDF for offline use
- Related Articles:
Let us know how you feel about this
last updated: 2017-06
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
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 (or for Mac).
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.
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.
Xamarin can be installed as part of a new Visual Studio 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).
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 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:
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:
Right-click the Windows Start button and select Programs and Features.
Right-click Microsoft Visual Studio and click Change.
When the Visual Studio Installer dialog appears, click the Modify button.
In the Features tab, scroll down to Cross Platform Mobile Development. Click the checkbox next to C#/.NET (Xamarin):
Click the UPDATE button to add Xamarin to Visual Studio.
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:
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:
For more information about locating version information, see Where can I find my version information and logs?
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.