cordova-plugin-ble-central icon indicating copy to clipboard operation
cordova-plugin-ble-central copied to clipboard

Document best practices on Android

Open peitschie opened this issue 2 years ago • 0 comments

Spawned from discussion on #963

The best approaches found on Android are:

  1. Use autoConnect and don't explicitly scan (i.e., let the OS schedule this itself)
  2. Explicitly scan and then use connect
  3. (Maybe) for a non-bonded device, it's safe to just use connect without an explicit scan (to be confirmed)

Additional things worth documenting:

  1. Permission flows and differences per Android version
  2. Location services & impacts on scanning
  3. Background processing
  4. Impacts of scan latency settings (https://github.com/don/cordova-plugin-ble-central/issues/959)
  5. Use of neverForLocation on Android 12+
  6. 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.

peitschie avatar May 30 '23 23:05 peitschie