Book Image

Xamarin 4.x Cross-Platform Application Development - Third Edition

By : Jonathan Peppers
Book Image

Xamarin 4.x Cross-Platform Application Development - Third Edition

By: Jonathan Peppers

Overview of this book

Xamarin is a leading cross-platform application development tool used by top companies such as Coca-Cola, Honeywell, and Alaska Airlines to build apps. Version 4 features significant updates to the platform including the release of Xamarin.Forms 2.0 and improvements have been made to the iOS and Android designers. Xamarin was acquired by Microsoft so it is now a part of the Visual Studio family. This book will show you how to build applications for iOS, Android, and Windows. You will be walked through the process of creating an application that comes complete with a back-end web service and native features such as GPS location, camera, push notifications, and other core features. Additionally, you’ll learn how to use external libraries with Xamarin and Xamarin.Forms to create user interfaces. This book also provides instructions for Visual Studio and Windows. This edition has been updated with new screenshots and detailed steps to provide you with a holistic overview of the new features in Xamarin 4.
Table of Contents (19 chapters)
Xamarin 4.x Cross-Platform Application Development - Third Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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.