Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
–
You can't. The emulator does not support Bluetooth, as mentioned in the SDK's docs and several other places. Android emulator does
not have bluetooth capabilities
".
You can only use real devices.
Emulator Limitations
The functional limitations of the emulator include:
No support for placing or receiving actual phone calls. However, You
can simulate phone calls (placed and received) through the emulator
console
No support for USB
No support for device-attached headphones
No support for determining SD card insert/eject
No support for WiFi, Bluetooth, NFC
Refer to the
documentation
Download Androidx86 from
this
This is an iso file, so you'd
need something like VMWare or VirtualBox to run it 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/Bluetooth device.
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.
Alternatively, Under settings of the virtual machine, Goto serialports -> Port 1 check Enable serial port select a port number
then select port mode as disconnected click ok. now, start virtual
machine. Under Devices -> USB Devices -> you can find your laptop
bluetooth listed. You can simply check the option and start testing
the android bluetooth application .
Source
–
–
–
It seems this has changed recently and they are now supporting Bluetooth as well in emulators with new API versions & google play services.
I'm using API level 32 with google play services to create emulators.
–
–
Now, in Android Studio 2022.1.1 (Electric eel) you
can
connect with Bluetooth between 2 emulators.
Official docs from Google
.
–
For Android Automotive there is a guide written here:
https://source.android.com/devices/automotive/start/passthrough#bluetooth
But it involves editing your kernel to activate bluetooth, and they testesd it with some USB Dongles only, but maybe worth a try.
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.