Using Bluetooth in Android Emulator

25,885

Solution 1

There are few limitations for the Android Emulator. The functional limitations include:

  • No support for placing or receiving actual phone calls. You can simulate phone calls (placed and received) through the emulator console, however.
  • No support for USB connections
  • No support for device-attached headphones
  • No support for determining network connected state
  • No support for determining battery charge level and AC charging state
  • No support for determining SD card insert/eject
  • No support for Bluetooth

-Reference Link

Solution 2

I've found the way to debug bt-enabled application on virtual android with real devices. That is not ADK emulator, and it has some flaws, but it definitely works.

Host computer works under Windows 7 64-bit with standard BT stack. Step by step:

  1. Install VMWare Player. It's free for non-commercial usage
  2. Create virtual machine. Set "Other linux 2.6" guest OS type.
  3. Choose reasonable amount of RAM. Remove SCSI disk and printer. Add IDE disk at least 1 GB, keep USB controller, ensure if bluetooth devices are shared with host computer.
  4. Download android installation from android-x86.org. I recommend Android 4.0 RC2 for EEE PC
  5. Point VM's CD to the ISO file.
  6. Start the VM and install android. Unfortunately, it's impossible to add google account there for now.
  7. Switch to android console(Alt-F1 inside virtual machine) and ask for IP address(use netcfg command, look at eth0 network interface), then switch back to GUI(Alt-F7)
  8. On host machine, run adb.exe connect your-vm-ip
  9. Enjoy!

Here is an illustrated tutorial in Russian

Solution 3

You can't use an emulator to test bluetooth apps. The BluetoothAdapter will remain null in emulator. You would need a bluetooth device.

Solution 4

Reference link of accepted no longer exists and I can't seem to find any other pages the mentioned the exact same details. However, it is mentioned in this docs:

What's not supported

The Android Emulator supports most features of a device, but doesn't include virtual hardware for:

  • WiFi
  • Bluetooth
  • NFC
  • SD card insert/eject
  • Device-attached headphones
  • USB

The watch emulator for Android Wear doesn't support the Overview (Recent Apps) button, D-pad, and fingerprint sensor.

While most end users of phones and tablets tend to use earlier API levels, Android Wear and Android TV users tend to use the latest releases. Using recent releases can give you a better experience using the emulator.

Share:
25,885
Adly
Author by

Adly

A Software Engineer (Perl, Java, C# and Rails).

Updated on July 09, 2022

Comments

  • Adly
    Adly almost 2 years

    If I wanted to implement an app for 2 Android devices so I can connect from one to the other via bluetooth, how can I do that via emulator?

    HINT: I don't have an Android phone for simulating.

    Thanks.