Last active
November 11, 2015 16:49
-
-
Save don/1953b1805489e5f11974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BluetoothManager manager = | |
(BluetoothManager) activity.getSystemService(Context.BLUETOOTH_SERVICE); | |
BluetoothAdapter adapter = manager.getAdapter(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bluetoothAdapter.startLeScan(callback); | |
// BluetoothAdapter.LeScanCallback | |
@Override | |
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { | |
// process scan results | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bluetoothAdapter.startLeScan(serviceUUIDs, callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bluetoothAdapter.stopLeScan(callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment