Phone as Bluetooth Headset - audio

I need my phone to act like a Bluetooth headset.
I am planning to run a J2ME application in Phone to make Phone as Bluetooth Headset.
Any idea how to do this?

Can't be done in J2ME as the Bluetooth API supports only SPP and L2CAP (and occasionally OBEX). Bluetooth headsets require the Headset profile.

Related

Bluetooth GATT send data to BLE device

how can I send Data to BLE device. I already Connected to ble device but don't know how to send and receive data Via Gatt Callback.
Have a look at the following resources that should help you get started:-
Ultimate Guide to Android BLE Development
Building Android Apps to Control Bluetooth LE Devices
Android Lollipop: BLE Matures (video)
Bluetooth LE Send String Data Between Two Devices
How to Use Android BLE to Communicate with Bluetooth Devices

Bluetooth Android and Bluetooth iOS

When I press a button on a device that is connected to iOS or Android via Bluetooth, it should perform some task in an app(app installed on iOS or Android). I am not sure which Bluetooth profile will be best for my job. I think HID profile, but will it work with iOS ? Any suggestions or comments are welcome.
iOS devices can't use standard Bluetooth connection with Android. In this case you should use BLE (Bluetooth Low Energy). This means you should use GATT profile for Android. There is an important issue here: all iOS devices can BLE peripheral or central but for Android some devices only can peripheral.

Detect mobile phone presence with Bluetooth usb dongle.

I am using BeagleBone Black and Bluetooth USB dongle V4.0. My dongle is detecting iBeacons with no problems but is there any way to detect mobile phones with bluetooth on. I am using NodeJs and Noble package.
So when I use hcitool lescan it's not finding mobile phone either but with hcitool there is option scan. When I call hcitool scan in terminal I get my mobile as result. Is there any NodeJs package that wraps this option. I have no need to connect to mobile device, I just need to discover it's presence, and see it's MAC address.
If you can see your device with "hcitool scan" and not with "hcitool lescan" it means your phone(or BT stack you use in phone) don't support BLE protocol. Not all BT devices are BLE capable.

Does the HC-05 bluetooth device support AVRCP commands?

I am trying to control the android music player from an Arduino with an HC-05 Bluetooth module. I have successfully paired them in serial mode but have been unable to find any means to connect them with the AVRCP profile. Is there a library that I can load into a sketch to do this?
The HC-05 supports SPP only. In order to get any other BlueTooth profile on there, you would have to create and flash different firmware for the Broadcom BC417143.

Android Bluetooth LE Chat example

I am trying to read serial data over Bluetooth LE but can't find any code examples for this type of bluetooth and api19. Does any one have an example?
There is no profile defined for serial data communication over Bluetooth Low Energy till now. For this one can use the Bluetooth classic only.
In any case, Android devices can not broadcast for advertising packets. They can only scan the advertising packets. Hence, these devices will be in Central mode only. But can act as either server or client.
For Bluetooth chat related app example one can refer Android SDK as,
sdk/samples/android-19/legacy/BluetoothChat
The above example is based on Bluetooth classic based on RFCOMM channel for serial communication.
Android 5.0 let mobile to be peripheral. So chat will be possible:
https://developer.android.com/about/versions/android-5.0.html
Bluetooth Classic got the SPP profile. This is not how Bluetooth Low Energy works.
In BLE you have 1 or more Services each with 1 or more Characteristics which are basically just bytes in a predefined format which by default can be max 23 bytes.
To send data from one device to another one must be the Master and the other must be Slave.
Android API19 does not support the Slave (Peripheral) role, it seems Google still doesn't understand the importance of Bluetooth Low Energy. It's so much more than just Pulse-readers.
You can send from an Android API19 phone to e.g. an iPhone which can be Slave/Peripheral.
You cannot send from an Android API19 phone to another API19 phone. For this you must use Bluetooth Classic SPP profile.

Resources