How Android app can initiate Bluetooth HFP and A2DP connection to Bluetooth Headset?
In my understand, Android app supports only SPP connection not HFP and A2DP.
However, I want to initiate HFP and A2DP connection in Android app just like selecting Bluetooth device in Bluetooth Settings menu. I'm not sure it is possible to use a intent including BluetothDevice object, so the intent receiver can initiate HFP and A2DP connection.
开发者_开发知识库If you have a idea, could you let me know that?
Basicly it is possible to use HFP from version 2.1. But theere are a lot troubles configuring the profile. In my case I couln't make it work on mac os but on ubuntu with limited functionality. I could initiate calls for instance. Anyway with bluez 4.6 I think hfp was merged upstream so you can make it work by enabling:
Enabled=Gateway
in your /etc/bluetooth/audio.conf
but the rest gets tricky, you can use raw dbus commands to initiate calls, or you might look at nohands HFP linux. Anyway it looks bad for audio transfer: Make Android Phone Call Audio go through A2DP Bluetooth Connection
精彩评论