Reputation: 12544
I want to make Bluetooth Discoverable , is there any way and does android allow my application to do this ?
I have found a link for this , but I do not know how can I do this .
[http://developer.android.com/reference/android/provider/Settings.System.html#BLUETOOTH_DISCOVERABILITY][1]
Upvotes: 0
Views: 1498
Reputation: 1641
By this code your device will be discoverable for 300 sec
if (mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);
startActivity(discoverableIntent);
}
Upvotes: 3