Skip to content

Best Practices & FAQ

Always use .Timeout(TimeSpan.FromSeconds(X)) on BLE observables. Android can hang on certain calls if a connection drops mid-operation.

While Shiny handles many known Android BLE issues internally, following these rules will save you from common pitfalls:

#Rule
1Don’t hold peripheral references across scans unless the device is connected.
2Don’t scan while connected to a GATT server — avoid overlapping radio operations.
3Don’t overwhelm the radio. Shiny queues operations internally, but rapid-fire calls still cause issues.
4Expect GATT 133 errors on connect. Catch exceptions in your observable subscriptions.
5Keep payloads small. BLE is not designed for large data or JSON — use compact binary formats.
6Always scan with a Service UUID filter. Unfiltered scans return every BLE device nearby and drain battery.
7Don’t discover all services & characteristics. Only query the ones you need — full discovery has a real performance cost.