Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何获得UUID?_Android_Sockets_Bluetooth_Uuid_Android Bluetooth - Fatal编程技术网

Android 如何获得UUID?

Android 如何获得UUID?,android,sockets,bluetooth,uuid,android-bluetooth,Android,Sockets,Bluetooth,Uuid,Android Bluetooth,不久前,我开始开发Android 我正在尝试创建一个BluetoothServerSocket 我有以下代码: tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID); NAME是我的服务器的名称(我可以在这里给出我想要的)还是不是 我不知道什么是myuuid。从哪里可以获取我的UUID?您可以使用BluetoothDevice类的getUUID()方法获取UUID。请参阅描述此过程的优秀线程,以及示例

不久前,我开始开发Android

我正在尝试创建一个
BluetoothServerSocket

我有以下代码:

tmp = mBluetoothAdapter.listenUsingRfcommWithServiceRecord(NAME, MY_UUID);
NAME
是我的服务器的名称(我可以在这里给出我想要的)还是不是


我不知道什么是
myuuid
。从哪里可以获取我的UUID?

您可以使用
BluetoothDevice
类的
getUUID()
方法获取UUID。请参阅描述此过程的优秀线程,以及示例和结果输出: