【问题标题】:Android Bluetooth Low Energy - How do I access previously paired device?Android 低功耗蓝牙 - 如何访问之前配对的设备?
【发布时间】:2015-09-21 16:23:23
【问题描述】:

我正在开发一个通过低功耗蓝牙连接到设备的 Android 应用。

我的问题是我无法找到一种方法来连接我之前连接的设备。在手机的蓝牙设置中,蓝牙设备显示为“已配对”,所以我想从应用程序连接到它以与它“交谈”。

有人知道怎么做吗?

提前致谢!

【问题讨论】:

    标签: android bluetooth bluetooth-lowenergy android-bluetooth


    【解决方案1】:

    您可以从 BluetoothAdapter 获取绑定设备列表:

    Set<BluetoothDevice> devices = myBluetoothAdapter.getBondedDevices();
    

    然后识别您感兴趣的设备并连接:

    myBluetoothGatt = myBluetoothDevice.connectGatt(context, false, myGattCallback);
    

    【讨论】:

      猜你喜欢
      • 2015-06-25
      • 2013-08-14
      • 2016-09-06
      • 1970-01-01
      • 2013-11-17
      • 2016-10-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多