I want to create an application based on bluetooth operation in android.I am using the following code
BluetoothAdapter adapter=BluetoothAdapter.getDefaultAd
The emulator doesnt support bluetooth as mentioned in the sdk's docs. You have to check this in real device..
And you got error Bluetooth binder is null. it means emulator does not have bluetooth capability.
You can't. The emulator does not support Bluetooth, as mentioned in the SDK's docs and on several other places.
And you already discovered this yourself: "the adapter is returning null value, which means the android emulator is not having bluetooth capability"
I'm currently planning a tool that is capable of emulating Bluetooth over TCP/IP under Linux (will be released freely under GPL).
This should be the solution when not having a real Bluetooth device (e.g. you want to simulate a connection between two emulated Android-x86 or Linux machines).
Maybe when compiling for Linux-ARM instead of Linux-x86 it will run in the Emulator, too.
It's not possible to run bluetooth aap on emulator.as there is no support for bluetooth on emulator. look at this http://developer.android.com/guide/developing/devices/emulator.html Emulator Limitations
In this release, the limitations of the emulator include:
You can but you will need to run your app on an Android inside a VirtualBox or VMWare image. For more infos, see here (tutorial is for Bluetooth LE, but it works just the same with other Bluetooth versions): Bluetooth Low Energy on Android Emulator
Yes, I agree, right now the emulator does not support Bluetooth.
To compile Android with Bluetooth support enabled, add the following line to BoardConfig.mk
.
BOARD_HAVE_BLUETOOTH := true