Running the code below, my Galaxy tablet (SCH-I905 - Android 4.0.4) correctly discovers three Bluetooth services on a PC. Running the same code on a Galaxy Nexus - Android 4.2.2) finds only one of the services. Any ideas are appreciated:
private final BroadcastReceiver ServiceReceiver = new BroadcastReceiver()
{
public void onReceive(Context context, Intent intent)
{
String action = intent.getAction();
if ( BluetoothDevice.ACTION_UUID.equals(action) )
{
BluetoothDevice device = intent.getParcelableExtra("android.bluetooth.device.extra.DEVICE");
Parcelable[] uuidExtra = intent.getParcelableArrayExtra("android.bluetooth.device.extra.UUID");
for( int i = 0; i < uuidExtra.length; i++ )
{
Toast.makeText( this, device.getName() + ": " + uuidExtra[i].toString(), Toast.LENGTH_LONG).show();
}
}
}
};
In the Eclipse debugger, the following array shows three occurrences [00001000-0000-1000-8000-00805f9b34fb, 00001115-0000-1000-8000-00805f9b34fb, 00001202-0000-1000-8000-00805f9b34fb] for the tablet, but only [00001115-0000-1000-8000-00805f9b34fb] for the Nexus. I don't know if it's a version or hardware issue. Thank you, John
One last note - I am using... BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); device.fetchUuidsWithSdp();