I am trying to connect my android device to BLE device. I am using the following code to do it.
mBluetoothGatt = mDevice.connectGatt(BaseApplication.getContext(), true, getInstance());
You can see the second parameter as true.In docs it is called as autoconnect flag. I can keep it true as well as false. What is the use of that flag ? Only thing that I have observed is that when I use autoconnect as true it connects for sure but with delay, if I use false it does not connect each time,sometime it does and sometime it does not. Also I would like to know is this the correct way to connect a saved device each time ? or is it only after scanning for first time and there is some other way to do it ? Thanks :)