Ckai~老西儿 2018-12-26 15:15 采纳率: 0%
浏览 2988

Android BluetoothA2dpSink相关问题

1 本人需要将Android设备添加蓝牙音响功能,所以需要实现BluetoothA2dpSink,在开始前,已修改内容如下:
1)/package/app/bluetooth/res/value/config.xml
true
2) /system/bt/include/bt_target.h
#define BTA_AV_SINK_INCLUDE TRUE
2 代码如下

 private void initBluetoothSink() {
        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
        mBluetoothAdapter.setName("ImiBluetooth");
        if (!mBluetoothAdapter.isEnabled()) {
            //弹出对话框提示用户是后打开
            Intent enabler = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(enabler, 1);
        }
        //获取A2DP代理对象
        mBluetoothAdapter.getProfileProxy(this, mListener, BluetoothProfile.A2DP);
    }

3 问题:
走到BluetoothSinkService.doBind()时一直
Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent);
也就是mContext.bindServiceAsUser(intent, mConnection, 0,
android.os.Process.myUserHandle())返回false
有没有大神面对过相关需求,及相应解决方案或思路?


  • 写回答

1条回答 默认 最新

  • hufen2740 2019-11-07 11:42
    关注

    这种一般要蓝牙模块技术支持的

    评论

报告相同问题?

悬赏问题

  • ¥20 怎么在stm32门禁成品上增加记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿
  • ¥15 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 解riccati方程组