Code example for BluetoothAdapter: Communicating over Bluetooth

Methods: cancelDiscovery, getBondedDevices, isDiscovering, startDiscovery

0
		} 
	} 
 
	public void resetDeviceSet(boolean doScan) {
		Log.d(TAG, String.format("resetDeviceSet(%s)", doScan ? "true" : "false"));
		deviceSet = new HashSet<BluetoothDevice>(adapter.getBondedDevices());
		if (doScan) {
			if (adapter.isDiscovering()) {
				adapter.cancelDiscovery();
			} 
			adapter.startDiscovery();
		} 
	} 
 
	public Set<BluetoothDevice> getDevices() {
		return deviceSet;
	} 
 
	public interface DiscoveryListener { 
		public void onStarted(); 
		public void onFinished();