BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Android Joins Visual Studio

Android Joins Visual Studio

Microsoft’s drive to extend Visual Studio’s reach into more areas of modern development continues with the first preview of its forthcoming Android emulator.  Part of the Visual Studio 2015 Preview, this emulator provides developers with a way to run and test their Android apps on a Windows 8.X machine.  This initiative reinforces the notion that the Visual Studio team has been given the latitude to be a tool for all developers, not just Windows-centric developers.

Microsoft’s Daniel Moth first explains that are a few key situations that are best served by directly testing on an actual device that an emulator cannot help.  First, for best results, performance testing needs to be conducted on the actual devices that need to be supported.  Likewise, hardware-specific performance or features must be tested directly on physical devices for accurate results.  Finally, usability testing should also be done on physical devices to ensure things such as physical accessibility are sufficient.

With this defined, what is an emulator ideally suitable for?  Moth presents the following four use cases where the use of an emulator makes the most sense, beginning with correctness.  Code-correctness benefits from the speed boost an emulator can typically provide in the edit-compile-debug cycle.  Second, the use of an emulator saves money by not requiring the purchase of a specific physical device for every platform that you wish to test your app on.  Another area when emulator helps is testing hardware sensors such as GPS—it is impractical to physically take a device all over the world to verify behavior.  Finally an emulator offers the convenience of behaving like any other application—without the hassle of worrying about USB cables and boot cycles.

Having laid this groundwork, Moth says that his team’s Android emulator is designed to achieve success by targeting these three areas:

  • Speed:  Moth says that current Android developers are frustrated with the speed of current emulators, so much so that in many cases developers prefer to test their app on a physical device.  In Moth’s view, the emulator “… should be faster than using a device so you can test your scenarios faster”.
  • Conflict with Hyper-V on Windows:  Many current emulators have various levels of conflicts with the presence of Hyper-V on a developer machine.  Multiple reboots throughout the day to toggle this setting waste time, so providing Hyper-V support would eliminate this waste.  It would also facilitate easier Windows Phone development, since this emulator requires Hyper-V support to be activated.
  • Visual Studio Integration:  Including the emulator with Visual Studio saves the expense of purchasing a separate product or having to install it in addition to Visual Studio.

The emulator supports multiple project types, including native C++ projects, Apache Cordova projects, and Xamarin projects.  Moth makes special note that if you want to use the VS emulator with a different IDE (perhaps to use one that supports Java), this is possible by launching the emulator in Visual Studio and “…then close that project and leave the emulator running and available for your other IDE to target (over [the Android Debug Bridge]/ADB)”.

The emulator provides the typical features expected, including zoom, orientation settings, network information, GPS (which allows entering a specific location or transitioning across multiple points), accelerometer, power & battery simulation, and the ability to take screenshots what the emulated device displays.  Android apps (APKs) can be installed and executed through the emulator if they target X86.  The emulator also offers SD card support (via mapping to a local VHD file on the host machine) and the ability to simulate camera usage.

Currently the emulator supports the emulation of two devices:  a 5” screen Android Phone style device running with a resolution of 720x1280 and a 7” screen Android tablet running with a resolution of 1080x1920.  The amount of RAM available to either device is configurable. 

There are some limitations that currently exist that team is seeking to address.  With this release the use of OpenGL 2.0 or higher is not supported.  The VS Emulator is currently limited to running Android’s KitKat API 19.  Apps using Google Play Services are not supported nor are ARM-based APKs, they must be recompiled for X86.  Finally, Hyper-V support is required and at present this means Windows 8.X or higher.

Moth is soliciting feedback from developers to assist him and his team as to what priority they place on the incomplete areas and what else they would like the emulator to provide.

Rate this Article

Adoption
Style

BT