Reader small image

You're reading from  Xamarin 4.x Cross-Platform Application Development - Third Edition

Product typeBook
Published inDec 2016
Reading LevelIntermediate
Publisher
ISBN-139781786465412
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
Jonathan Peppers
Jonathan Peppers
author image
Jonathan Peppers

Jonathan Peppers is a Xamarin MVP and lead developer on popular apps and games at Hitcents such as the Hanx Writer (for Tom Hanks) and the Draw a Stickman franchise. Jon has been working with C# for over 10 years working on a wide range of projects at Hitcents. Jon began his career working Self-Checkout software written in WinForms and later migrated to WPF. Over his career, he has worked with many .NET-centric technologies such as ASP.Net WebForms, MVC, Windows Azure, WinRT/UWP, F#, and Unity3D. In recent years, Hitcents has been heavily investing in mobile development with Xamarin, and has development over 50 mobile applications across multiple platforms.
Read more about Jonathan Peppers

Right arrow

Setting up the Android emulator


The Android emulator has historically been known to be sluggish compared to developing on a physical device. To help solve this issue, Google has produced an x86 emulator that supports hardware acceleration on desktop computers. It isn't installed by default in the Android Virtual Device (AVD) Manager, so let's set that up.

The x86 Android emulator can be installed by performing the following steps:

  1. Open Xamarin Studio.

  2. Launch Tools | Open Android SDK Manager....

  3. Scroll down to Extras; install Intel x86 Emulator Accelerator (HAXM Installer).

  4. Scroll to Android 6.0 (API 23); install Intel x86 Atom System Image.

  5. Optionally, install any other packages you are interested in. At the minimum, make sure you have everything that the Android SDK Manager selects for you to install by default.

  6. Close the Android SDK Manager and navigate to your Android SDK directory, by default located at ~/Library/Developer/Xamarin/android-sdk-macosx.

  7. Navigate to extras/intel/Hardware_Accelerated_Execution_Manager and launch IntelHAXM_6.0.3.dmg to install the HAXM driver.

  8. Switch back to Xamarin Studio and launch Tools | Open Google Emulator Manager....

  9. Click on Create....

  10. Enter an AVD name of your choice, such as x86 Emulator.

  11. Pick a generic device that will be appropriately sized for your display, such as the Nexus 5.

  12. As CPU/ABI, make sure you select an option that supports Intel Atom (x86).

  13. After creating the device, go ahead and click on Start... to make sure the emulator runs properly.

Tip

These instructions should be very similar on Windows. By default, the Android SDK is installed at C:\Program Files (x86)\Android\android-sdk on Windows. Likewise, the HAXM installer is named intelhaxm-android.exe on Windows.

The emulator will take some time to start up, so it is a good idea to leave the emulator running while working on an Android project. Xamarin is using the standard Android tools here, so even Java developers feel the pain of the sluggish emulator. If everything starts properly, you will see an Android boot screen followed by a virtual Android device ready for deploying applications from Xamarin Studio, as shown in the following screenshot:

There are many options out there for Android emulators, such as Genymotion or Visual Studio Android Emulator. Using Xamarin will not limit your choices in Android emulators, so feel free to experiment if the default Android emulator isn't working for you.

Previous PageNext Page
You have been reading a chapter from
Xamarin 4.x Cross-Platform Application Development - Third Edition
Published in: Dec 2016Publisher: ISBN-13: 9781786465412
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Jonathan Peppers

Jonathan Peppers is a Xamarin MVP and lead developer on popular apps and games at Hitcents such as the Hanx Writer (for Tom Hanks) and the Draw a Stickman franchise. Jon has been working with C# for over 10 years working on a wide range of projects at Hitcents. Jon began his career working Self-Checkout software written in WinForms and later migrated to WPF. Over his career, he has worked with many .NET-centric technologies such as ASP.Net WebForms, MVC, Windows Azure, WinRT/UWP, F#, and Unity3D. In recent years, Hitcents has been heavily investing in mobile development with Xamarin, and has development over 50 mobile applications across multiple platforms.
Read more about Jonathan Peppers