Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to test bluetooth application on emulators in android

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?

like image 562
user590849 Avatar asked Aug 18 '11 06:08

user590849


People also ask

Do any Android emulators support Bluetooth?

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.

Does Bluetooth Work in emulator?

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.

Does NOX emulator support Bluetooth?

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.

Can BlueStacks use Bluetooth?

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.


1 Answers

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.

like image 189
Vivek Avatar answered Oct 01 '22 09:10

Vivek