You need to turn on Bluetooth and make it visible (for an infinite amount of time or at least for 3-4 hours) for all devices.
Now I do this:
public void EnabledBluetooth(Activity activity){/* включаем блютуз и делаем его видимым*/ Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); int dur = 0; // или // 300; discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, dur); activity.startActivityForResult(discoverableIntent, Constants.REQUEST_ENABLE_BT); }
This code works, but not on all devices.
Powered by DNS 4003, HTC one, xiaomi redmi node 3, and on Fly IQ4412 Quad does not work (Bluetooth turns on but its visibility is set to 1.59 minutes)
What can you tell? Is it realistic to make it work on all devices? Where to dig? Maybe some other parameters need to be passed in the Intent?