How Visual Studio Emulator for Android can improve your Android development


Introduction

About two years ago I created my Hello World app on Android and when I run it on the emulator and I’ve found my first trouble: the emulator was terribly slow. After searching a bit on the web I’ve found some adjustment that can improve the AVD performance: Intel HAXM and “Use host GPU” when creating an AVD can give a performance boost to the emulator.

About a year later, I’ve found a VirualBox based emulator for Android called Genymotion with new features, more user friendly in comparison with AVD and, last but not least, it is a lot faster than the first. So I’ve switch to Genymotion and used it with pleasure until 4 months ago..but what happened 4 months ago?

4 months ago I’ve updated my Windows 8.1 PC to Windows 10 Insider Preview and I noticed that Genymotion doesn’t works anymore and after searching informations about that I’ve found that the problems was related to a VirtualBox bug that prevents the correct function of Genymotion on Windows 10 (about 3 weeks later the public release of Windows 10 this bug is still present). At that time I was attempted to downgrade to Windows 8.1 and continue to use Genymotion but…


Visual Studio Emulator for Android

I’ve been using Visual Studio for 4 years and I’ve feel surprised when I’ve recently found this article on MSDN blog: Introducing Visual Studio’s Emulator for Android. This was a great notice because on Windows 10, as written before, I was not able to use Genymotion so I’ve downloaded and installed VS Emulator and what a surprise: it works perfectly and it’s very snappy with great tools!

When you open VS Emulator a window will appear like the one below:

Visual Studio Emulator for Android main screen

In this window you can choose the API level that you want (starting from API 17 — about 78% of Android devices) for your emulator and download new system images for other API levels. When the download in finished you can click on the green play button and the emulator will be launched:

Visual Studio Emulator for Android running Android Lollipop (API 22)

On the right of the emulator you will find a toolbar with a lot features built on a simple user friendly interface where you can access to the accelerometer, position, battery, camera, etc..

Visual Studio Emulator for Android tools

AVD vs VS Emulator performance comparison

To giving you an idea of how it works I’ve made some simple tests (time in minutes): Test 1 — Emulator opening and Android booting time, Test 2 — Emulator booting time (from Android logo), Test 3 — Hello World install and opening time

AVD vs VS Emulator performance comparison

As you can see Visual Studio Emulator for Android is up to 5x faster than Android Virtual Device, so why are you still using AVD?


Visual Studio Emulator for Android pros and cons

Let’s start with pros:

  • faster than AVD
  • easier and better user interface
  • less space required (about 850MB vs 1.30GB)

And cons:

  • it requires Hyper-v so it works only on Windows PCs and some virtualization programs may not works if Hyper-v is enabled