Top Banner
Windows Installing Xamarin.Android on Windows Overview 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 platform and to get our development environment set up, including how to: Download the Installer Run the Installer Configure the IDE Deploy to Device Configure Android 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.
28

Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Jul 24, 2018

Download

Documents

NguyễnHạnh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically detect, download, and install any componentsrequired for completing the installation. This tutorial examines the installation and configuration stepsrequired to install the Xamarin platform and to get our development environment set up, includinghow to:

Download the InstallerRun the InstallerConfigure the IDEDeploy to DeviceConfigure Android 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 receivedwith your purchase.

Page 2: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

1.

2.

Running the Xamarin Installer The installer steps are as follows:

Begin the installation process:

Continue (optionally configure proxy settings using the link at the bottom of this screen):

Page 3: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

3. Choose which features to install (ensure that Xamarin.iOS is ticked):

Page 4: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

4. Agree to the Android installation location (if you are also installing Xamarin.Android):

Page 5: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

5. Review the list of products to be downloaded and installed.

Page 6: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

6. Tick the box to accept the license agreement.

Page 7: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

7. The status bar shows installation progress. Progress for each product will be displayed.

Page 8: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

8. Once installation is complete, you’ll see another progress window while Windows is configured.

Page 9: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

9. Once the installation is done, Visual Studio is started automatically in the background so youcan start building applications right away.

Page 10: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Close this window to exit the installer and begin working with Xamarin. Configuring the Installation Now that we’ve installed the components, we need to tell our IDE where to find them. XamarinStudio and Visual Studio both have configuration options that let us specify the Java and AndroidSDK locations. During installation, the installer places the installed components in their default locations andconfigures the development environment with the appropriate path configuration. However, if wealready had them installed or if we installed them in locations other than the default, then we mustexplicitly specify the paths to these components. Configuring Xamarin Studio To configure SDK locations in Xamarin Studio, go to Xamarin Studio Preferences, then select Build> SDK Locations > Android from the left tree-view panel in the dialog:

Page 11: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Configuring Visual Studio To configure the Visual Studio tools, navigate to Tools -> Options -> Xamarin -> Android Settings:

Page 12: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Deploying to Device To configure an Android device for development, you must first install OEM USB drivers. Then, turnon developer mode to allow USB debugging and keep the device awake during deployment. Instructions for installing OEM USB Drivers are available in the Android documentation. Configure Android Versions 4.1 and Older Navigate to Settings > Applications > Development or Settings > Developer Options:

Page 14: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Then, configure options as illustrated by the following screenshot:

Page 16: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Configure Android Versions 4.2 and Newer Developer mode is hidden in later versions of Android. To turn on developer mode, go to Settings and scroll down to the System section. Then, select About phone. In the screenshot below,developer options are already available, but they may not be available yet on your device, so we willlearn how to enable them next:

Page 18: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Scroll down to the bottom and click on Build number 7 times to enable Developer Settings:

Page 20: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Once the Developer Options tab is available on the About phone screen, open it to reveal developersettings:

Page 22: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Plug the device into your machine, and deploy using Xamarin Studio: For more information, see the Android documentation on Setting Up a Device for Development. Configuring Android Emulators You can run the Android Emulator in a variety of configurations to simulate different devices. Eachone of these configurations is created as a Virtual Device. By default, the Xamarin.Android installerwill create a virtual device for each of the Android platforms registered by the installer. However, wecan create our own custom virtual device configuration. Virtual devices are configured via the Android Virtual Device (AVD) Manager. The AVD Manager caneither be launched from the Android SDK Manager, or directly from Xamarin Studio (if we’re using it). Launching the AVD Manager from Xamarin Studio If we’re using Xamarin Studio and have an open project, the AVD Manager can be launched directlyby selecting Tools > Managed AVDs from the menu bar:

Launching the AVD Manager from the Android SDK Manager We can launch the Android SDK Manager from the Start menu like this:

Once we have located and opened the Android SDK Manager, we can launch the AVD Manager bynavigating to the top menu bar and then selecting Tools > Manage AVDs...

Page 23: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Creating a new Virtual Device Once the AVD Manager is open, we can create a new virtual device by clicking New...

Page 24: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

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

Page 26: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Once we’re finished configuring the device, we can select Create AVD. We can then see that thedevice was created successfully with the hardware configuration options we specified by checkingthe dialog shown below:

Using Genymotion Emulator (Optional) Genymotion is a faster, lightweight alternative to the traditional Android emulator. It offers x86architecture and OpenGL hardware acceleration, and is easy to use. To run Genymotion onWindows, register with Genymotion and follow instructions to download and install the emulator.

Page 27: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

Once you have Genymotion running with virtual devices set up, you can deploy directly to theGenymotion emulator from Visual or Xamarin Studio:

Launch SDK ManagerUse the SDK manager to install updates and develop for different API levels. Refer to the Launch

Page 28: Windows - Brihat Investmentsbrihatinvestments.com/downloadfile-offline.pdf · Windows Installing Xamarin.Android on Windows Overview The Xamarin.Android installer will automatically

SDK Manager recipe for more information. That’s it! Now we’re all set up to use Xamarin.Android to create Android applications! Summary In this article, we examined how to set up and install the Xamarin.Android platform on Windows. Wealso looked at some different ways to configure our platform installation in Xamarin Studio and inVisual Studio. And we showed you how to use the Android Virtual Device Manager to define yourAndroid SDK Emulator configurations. In the next tutorial, we’ll use Xamarin.Android to create our first Android application.