cordova-plugin-ble-central
cordova-plugin-ble-central copied to clipboard
Document best practices on Android
Spawned from discussion on #963
The best approaches found on Android are:
- Use autoConnect and don't explicitly scan (i.e., let the OS schedule this itself)
- Explicitly scan and then use connect
- (Maybe) for a non-bonded device, it's safe to just use connect without an explicit scan (to be confirmed)
Additional things worth documenting:
- Permission flows and differences per Android version
- Location services & impacts on scanning
- Background processing
- Impacts of scan latency settings (https://github.com/don/cordova-plugin-ble-central/issues/959)
- Use of
neverForLocationon Android 12+ - Android disconnect supervision timeouts, and why rapid reconnects can often fail
Documenting the known caveats and quirks would help implementors more effectively use this plugin.