android 蓝牙操作
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if(adapter != null)
{
if(adapter.isEnabled()
{
Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivity(intent);
}
set<BluetoothDevice>devices = adapter.getBondedDevices();
if(devices.size()>0)
{
for(Iterator iterator = devices.iterator();iterator.hasNext();)
{
BluetoothDevices bluetoothDevice =(BluetoothDevice)iterator.next();
}
}
}