Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Xamarin 4.x Cross-Platform Application Development

You're reading from   Xamarin 4.x Cross-Platform Application Development Develop powerful cross-platform applications with Xamarin

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher
ISBN-13 9781786465412
Length 292 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jonathan Peppers Jonathan Peppers
Author Profile Icon Jonathan Peppers
Jonathan Peppers
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Xamarin Setup FREE CHAPTER 2. Hello, Platforms! 3. Code Sharing Between iOS and Android 4. XamSnap - A Cross-Platform App 5. XamSnap for iOS 6. XamSnap for Android 7. Deploying and Testing on Devices 8. Contacts, Camera, and Location 9. Web Services with Push Notifications 10. Third-Party Libraries 11. Xamarin.Forms 12. App Store Submission

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:

Setting up the Android emulator

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.

You have been reading a chapter from
Xamarin 4.x Cross-Platform Application Development - Third Edition
Published in: Dec 2016
Publisher:
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.
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 $19.99/month. Cancel anytime
Banner background image