What problem does it solve?
Android Bluetooth connections frequently fail due to incorrect transport choice, missing runtime permissions, unreliable disconnect detection, and stale socket state—causing apps to appear connected when they are not or to get stuck in reconnect loops.
Core Features & Use Cases
- Permissions & Android version matrix: Fix silent failures by selecting the correct BLUETOOTH_SCAN/CONNECT permissions (and legacy ones) plus the required connected-device foreground service handling.
- Classic Bluetooth (SPP/RFCOMM) connection workflow: Route discovery vs bonded-device enumeration, create sockets using a prioritized path (reflection, secure, insecure), and connect with retry plus teardown delays to avoid race conditions.
- Robust disconnect detection & lifecycle-safe state: Detect dead links via I/O read-loop failures and heartbeats (with ACL_DISCONNECTED as backup), using idempotent disconnect handling and a real connection state machine.
- BLE/GATT guidance: Support BLE use cases such as race trackers and sensors by handling GATT discovery and notification/MTU setup via the referenced BLE documentation.
Use case example: You built an Android app to connect to an OBDLink-style classic SPP adapter and sometimes it connects once but fails on subsequent attempts; apply this skill to fix socket creation order, teardown timing, permissions, and disconnect/reconnect logic.
Quick Start
Use the android-bluetooth skill to troubleshoot your Android app that connects to a Bluetooth device but shows connected incorrectly or gets stuck during reconnect for the device you are pairing.