Setting up your Android x86 emulator

3940
0
06-16-2017 01:04 PM
Labels (1)
EricBader
Occasional Contributor III
1 0 3,940

You can use an Android x86 emulator for testing your applications in Qt Creator. This particular emulator has a much faster start-up time than the Android ARM emulators, which in turn speeds up your time spent on testing. However, setting up your development environment for this can be tricky! Here are some  steps that we hope will help you get started.

First of all, we highly recommend that you use Qt 5.9.0+, as this provides support for "host GPU". Prior versions of Qt should work also, but you'd have to disable host GPU support, which slows up the process, so much so that the emulator becomes simply unusable.

Install the Android SDK x86 bits

First, make sure the proper Android SDK API level is installed by running the Android SDK Manager, and be sure to install the x86 packages. The Intel x86 Atom System Image , for example, seems to work well. 

Install Intel® Hardware Accelerated Execution Manager (Intel® HAXM)

Intel® Hardware Accelerated Execution Manager (Intel® HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel® Virtualization Technology (Intel® VT) to speed up Android* app emulation on a host machine. Note that HAXM is only supported on machines with Intel® processors.

You can download it from here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager/. Or, you can install it using the Android SDK manager: 

Then, access the HAXM dmg installer from your Android SDK install:<path_to_android_sdk>/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager

Set up the Android x86 emulator device

Start the AVD Manager. You can also launch AVD Manager from Qt Creator's Android device settings: 

Create a new device. For the Target, select Android 6.0 - API Level 23 , for example. Make sure CPU/ABI is selected as Intel Atom (x86). At the bottom of the form check, the Use Host GPU box. Then click OK to create the device.

Here is an example:

 

You should now see your Android Virtual Device added in the AVD Manager. Start the device by selecting it in the list and clicking Start.... This should launch the emulator that you created. If you receive errors about HAXM, then repeat the step above about installing HAXM.

You're all set!

Now you can create an Android x86 template project, choose Android x86 in the project configuration, and hit the Play button to deploy and launch the app on the Android emulator device that was just created. If you don't see the Android device in the list of devices from Qt Creator, then a configuration step must have been missed.

Enjoy!

Sincerely,

The ArcGIS Runtime SDK for Qt Development Team