高手懂蓝牙的进来哈~小弟碰到麻烦了~
在android4.0.3环境下 连接蓝牙耳机 通过socket.connect()的方法 无响应。修改4.0.3库调用隐藏api 使用mBluetoothA2dp.connect(mDevice)返回 false,下面是输出LOG--------------------编程问答-------------------- 请贴完整代码,信息太少。 --------------------编程问答--------------------
A2DP连不上,HFP连上了,代码发你关于A2DP的连不上的代码
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
mBluetoothAdapter.getProfileProxy(getBaseContext(), mProfileListener, BluetoothProfile.A2DP);
public void onServiceConnected(int profile, BluetoothProfile proxy) {
if (profile == BluetoothProfile.A2DP) {
System.out.println("456");
mBluetoothA2dp = (BluetoothA2dp) proxy;
}
}
System.out.println(mBluetoothA2dp.resumeSink(mDevice));
System.out.println(mBluetoothA2dp.connect(mDevice));
System.out.println(mBluetoothA2dp.isA2dpPlaying(mDevice));
System.out.println(mBluetoothA2dp.getPriority(mDevice));
--------------------编程问答--------------------
返回全体flase --------------------编程问答-------------------- 求高手啊!~~~
补充:移动开发 , Android