Pick Bluetooth Device
PICK_BLUETOOTH_DEVICE
Let the user pick a Bluetooth Device. Returns MAC Address and Name.
Use
public void startPickBluetoothDevice() {
Intent intent = new Intent("PICK_BLUETOOTH_DEVICE");
if (intent.resolveActivity(getPackageManager()) != null) {
startActivityForResult(intent, REQUEST_CODE);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
String macAddress = data.getStringExtra(ADDR);
String name = data.getStringExtra(FRIENDLYNAME);
// handle result
}
}Example intent filter
<activity ...>
<intent-filter>
<action android:name="PICK_BLUETOOTH_DEVICE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Apps Providing an Implementation
Search on Google Play, AppBrain, Amazon App store or similar (not yet available - please make this happen!)
For Specification Writers
Edit on Github