9 7 | I was browing Stack and the internet for a simple solution to get the The doc tells me So I need to know the following: 1) Is the function returning really the device 2) How do I get an instance of this Thanks! | ||||
|
1 Answer
13 accepted | Using reflection you can invoke the hidden method 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());} This is the result on a Nexus S: UUID: 00001000-0000-1000-8000-00805f9b34fbUUID: 00001001-0000-1000-8000-00805f9b34fbUUID: 00001200-0000-1000-8000-00805f9b34fbUUID: 0000110a-0000-1000-8000-00805f9b34fbUUID: 0000110c-0000-1000-8000-00805f9b34fbUUID: 00001112-0000-1000-8000-00805f9b34fbUUID: 00001105-0000-1000-8000-00805f9b34fbUUID: 0000111f-0000-1000-8000-00805f9b34fbUUID: 0000112f-0000-1000-8000-00805f9b34fbUUID: 00001116-0000-1000-8000-00805f9b34fb where, for instance, | ||||||||||||||||||||
|
Your Answer
stackoverflow.com/questions/19630810/android-get-bluetooth-uuid-for-this-device