あなたはBluetoothAdater
に隠された方法getUuids()
を呼び出すことができますリフレクションを使用:
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
Method getUuidsMethod = BluetoothAdapter.class.getDeclaredMethod("getUuids", null);
ParcelUuid[] uuids = (ParcelUuid[]) getUuidsMethod.invoke(adapter, null);
for (ParcelUuid uuid: uuids) {
Log.d(TAG, "UUID: " + uuid.getUuid().toString());
}
これは、ネクサスSの結果である:例えば、0000111f-0000-1000-8000-00805f9b34fb
がHandsfreeAudioGatewayServiceClass
のためである、
UUID: 00001000-0000-1000-8000-00805f9b34fb
UUID: 00001001-0000-1000-8000-00805f9b34fb
UUID: 00001200-0000-1000-8000-00805f9b34fb
UUID: 0000110a-0000-1000-8000-00805f9b34fb
UUID: 0000110c-0000-1000-8000-00805f9b34fb
UUID: 00001112-0000-1000-8000-00805f9b34fb
UUID: 00001105-0000-1000-8000-00805f9b34fb
UUID: 0000111f-0000-1000-8000-00805f9b34fb
UUID: 0000112f-0000-1000-8000-00805f9b34fb
UUID: 00001116-0000-1000-8000-00805f9b34fb
と00001105-0000-1000-8000-00805f9b34fb
はOBEXObjectPushServiceClass
です。この方法の実際の利用可能性は、デバイスとファームウェアのバージョンによって異なる場合があります。
とにかく、あなたのBluetoothデバイスのUUIDが@Ronであることをどのように知ることができますか? – gumuruh