Xamarin Mobile Application Development for Android(Second Edition)
上QQ阅读APP看书,第一时间看更新

Creating Android Virtual Devices

The Android emulator, also known as Android Virtual Device (AVD), is used to test the Android application in the absence of a device. Emulators get installed as part of the Xamarin installation. You can create your own emulator or customize an existing one with the required device configurations for the device being emulated.

In order to create or modify an existing emulator, perform the following steps:

  1. From the main menu bar, navigate to Tools and open Google Emulator Manager. It will open the Android Virtual Device Manager window:
    Creating Android Virtual Devices
  2. To create a new emulator, click on the Create button, on the right-hand side panel. Provide the configurations, such as AVD Name, Device, Target, Memory Options, and so on.
  3. To edit an existing emulator, select the emulator you wish to edit and click on the Edit button:
    Creating Android Virtual Devices
  4. Note the Target setting; this specifies the version of the Android platform and the API level that will be used for the emulator.
  5. Select the device skin from the Device field drop-down menu. In my case, I have selected Nexus 5.
  6. Set the Target field to Android 4.4.2. If needed, uncheck the Hardware keyboard present option, and click on OK.
  7. Check the Use Host GPU option. This option makes the emulator use the host computer's OpenGL implementation, which makes the rendering significantly faster.
  8. You may select the Snapshot option to speed up the emulator's boot time. When this option is enabled, it saves a snapshot of its RAM on the first boot and restores from that snapshot on future use. You cannot have both the Snapshot and Use Host GPU options enabled at the same time.