android - 是否有任何蓝牙设备唯一标识

标签 android bluetooth

我希望我的程序在某些蓝牙设备打开时使用react。所以我想知道是否有每个蓝牙设备的唯一 ID 可用于通过 BluetoothDevice android 类识别蓝牙设备。我无法使用设备名称,因为有很多同名设备: 这是我得到这个名字的方式:

  Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();

            for (BluetoothDevice bt : pairedDevices) {
                String bluetoothDevice = bt.getName();
    }

最佳答案

您可以使用 device address :

bt.getAddress();

关于android - 是否有任何蓝牙设备唯一标识,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20659107/

相关文章:

android - 如何在 android 中为不同的 2 密度(如 mdpi、ldpi、hdpi)使用 9 个补丁图像。?

android - getSupportFragmentManager() - 类型 Context 未定义

iphone - 在 MacOS 上通过命令行连接到蓝牙设备 (iPhone)

android - 在 Android 上使用 Phonegap 通过蓝牙进行设备间通信?

java - 单击按钮时,为什么我的应用程序会崩溃?

android - 错误 :Unable to find method 'com. android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;安卓工作室 3

ios - 在 iOS SDK 上,有没有办法以编程方式连接到特定的蓝牙 PAN?

android - Arduino 和 Android 之间的蓝牙串口通信问题

android - 谷歌地图实用程序中集群的背景渲染

android - 从android中的类访问后台服务中的对象