The development experience using Visual Studio 2015 creating apps for Android or Windows Phone is amazing. Until you get to a point where you need to work with Bluetooth, the you realize that the emulator does not support this feature and you need to find a workaround. So far the best alternative option I’ve found is this one
1. Download an image of Android from http://www.android-x86.org/
2. Install VirtualBox
3. Create a VM using the image downloaded in 1 point
4. Set the VM image to use a local USB device where you have Bluetooth dongle. In this case it is a BlueTooth 4.0 ASUS adapter
Now you can launch the emulator and have a fully working Android which supports Bluetooth and Bluetooth LE emulation. However, even if this works, the development experience is a bit poor. Personally I prefer to deploy the APK on my mobile and test the app in the phone. This also allows us to debug step by step and as a Developer in a very complete experience with Visual Studio 2015. For example, the following image shows the debugging options of Xamarin Android apps in Visual Studio. In addition to several VMs with Android, it is a plugged in Samsung device. This is so cool.
Going back to VirtualBox and VMs, the main problem I found is this one:
If you work with 10 Windows and Visual Studio 2015, if you install other virtual machines managers or software which changes your networks settings; it is likely that the Hyper-V configuration raises tons of exceptions.
Luck for us, our MSDN friends shared a great article which explains, plenty of the scenarios where the emulator does not work fine. I’ve been reviewing the network settings and I could not find the error.
Until I found it in the settings of Hyper-V. In the virtual adapter that is used for the VMs of Android and Windows Phone, the type of connection should be Internal network.
2 Click then could already prove the graphic aspects of my app in the emulator. I do BlueTooth tests directly in the physical device
I strongly recommend to give a look at the link to MSDN references. It covers many errors scenarios that certainly will save you many headaches!
Saludos @ Madrid
– Android on X86 http://www.android-x86.org/
– Oracle Virtual Box https://www.virtualbox.org/
– ASUS BT 400 http://www.amazon.es/gp/product/B00CM83SC0
– MSDN Emulator Fails to Start https://msdn.microsoft.com/en-us/library/mt228282.aspx?f=255&MSPPError=-2147217396#NoStart
[Tags Visual Studio 2015, Xamarin, Android, Hyper-V, VM, English Post]