I've made a Bluetooth chat application on Android and I need to test it, but I do not own an Android phone so I am dependent on an emulator for all my testing purposes. Is there a way for me to test Bluetooth-based applications on an Android emulator? I am using Eclipse for development. I'd like to run 2 emulators simultaneously and see if my chat application is working properly or not.
Also, how can I integrate the new emulator with Eclipse?
Android-x86 supports Bluetooth connections (if your PC has Bluetooth functionality), which means you can pretty much connect any Bluetooth device to your Android-x86 emulator and use it with it.
How do I use the bluetooth in Android emulators like Bluestacks or any other software? You can't. The emulator does not support Bluetooth and android emulator does not have Bluetooth capabilities". You can only use real devices.
Please make sure to use the USB to connect the controller. At present, NoxPlayerr only supports USB connection but does not support Bluetooth connection. Check if the controller has connected to your pc in the computer settings.
Hence, all apps which require control of Bluetooth or infrared sensors may not work on BlueStacks. Due to this, a Bluetooth device that functions on your PC will not perform the desired functions within BlueStacks. Future versions of BlueStacks may provide support for Bluetooth devices.
Fortunately, there is a way out - Install the Android image on a VM and use your own Bluetooth device. Follow these Steps:
Download Androidx86 from http://www.android-x86.org/. This is an .iso file, so you'd need something like VMWare or VirtualBox to run it. Me, I use VirtualBox.
When creating the virtual machine, you need to set the type of guest OS as Linux instead of Other.
After creating the virtual machine, set the network adapter to 'Bridged'.
Start the VM and select 'Live CD VESA' at boot.
Now you need to find out the ip of this VM. Go to terminal in VM (use Alt+F1 & Alt+F7 to toggle) and use the netcfg command to find this.
Now you need open a command prompt and go to your android install folder (on host). This is usually C:\Program Files\Android\android-sdk\platform-tools>.
Type adb connect IP_ADDRESS
There done! Now you need to add Bluetooth. Plug in your USB Bluetooth dongle.
In VirtualBox screen, go to Devices>USB devices. Select your dongle.
Done! now your Android VM has Bluetooth. Try powering on Bluetooth and discovering/paring with other devices.
Now all that remains is to go to Eclipse, and run your program. The Android AVD manager should show the VM as a device on the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With