I am developing a BLE application on Nexus 4 using Android BLE API. I have a few questions/doubts:
1) Is there a way to set/override the connection or notification interval of BLE central device. I have found that for Android, the default connection interval is fixed to 7.5ms. Is there a way to change this connection/notification delay interval settings.
2) On connecting to the remote device, I am facing an issue of getting disconnection after random period of time interval. There are many people facing the connection drop issue stating that android is unstable when they are using Android 4.3 API for BLE connection. Is there any solution for this?
EDIT
what else I observe here is when it is taking time to reconnect then it's coming with some L2CAP log ...following the log
Trying to create a new connection laststate_ BOND_NONE
D/BluetoothGatt( 9620): connect() - device: 1C:BA:81:11:CA:36, auto: true
D/BluetoothGatt( 9620): registerApp()
D/BluetoothGatt( 9620): registerApp() - UUID=1a9a0911-4d5c-41dc-8ac0-0284ef550510
D/BtGatt.GattService( 3208): registerClient() - UUID=1adsds0911-4sdsc-41dc-8ac0-0sdsdf550510
D/BtGatt.btif( 3208): btif_gattc_register_app
D/BtGatt.btif( 3208): btgattc_handle_event: Event 1000
D/BtGatt.btif( 3208): btif_gattc_upstreams_evt: Event 0
D/BtGatt.GattService( 3208): onClientRegistered() - UUID=1a9a0911-4d5c-41dc-8ac0-0284ef550510, clientIf=5
D/BluetoothGatt( 9620): onClientRegistered() - status=0 clientIf=5
D/BtGatt.GattService( 3208): clientConnect() - address=1C:BA:8C:1E:CA:36, isDirect=true
D/BtGatt.btif( 3208): btif_gattc_open
D/BtGatt.btif( 3208): btgattc_handle_event: Event 1004
D/BtGatt.btif( 3208): btif_get_device_type: Device [1c:ba:8c:1e:ca:36] type 2, addr. type 0
W/bt-l2cap( 3208): L2CAP - LE - cannot start new connection at conn st: 3
Any idea how can clear cahce mantain by L2CAP?
For your first question, as OneWorld said, it is advisable to let smartphone handle the connection delay interval settings. This settings are closely dependent on bluetooth hardware & stack used for particular smartphone.
About the disconnection issue, I also faced similar issues. I think, this is due to an issue logged in given link. When OS handles connection & pairing, you can not unpair the device and all the re-connection attempts fail after this. This doesn't happen if the device paired(& unpaired) programmatically using private APIs on 4.3, assuming you have have handled GATT connections correctly. In android 4.4.2, there is createBond API added for pairing. So with 4.4.2, communication works pretty well.
Regarding the stability of Bluetooth low energy on android, I can confirm that it is pretty unstable. I have tested an application installed on Nexus 4 & Nexus 5 with a low energy sensor. In spite of having the same OS version 4.4.2, both devices gave different results for connection. I observed that device got disconnected after certain time on Nexus 4 while for Nexus 5 things worked well.
Hope this helps you moving forward for your problem.