Forcing the Signal - Classic Bluetooth
Last updated
Last updated
Bluetooth connections are now very reliable, but problems can still occur. Especially with classic Bluetooth connections and also problems with missing . Some Bluetooth problems could also occur if the necessary permissions are granted during ongoing operations.
Please ensure that all necessary permissions are obtained before any app specific Bluetooth operations.
Unlike Bluetooth Low Energy (BLE), where connection status and changes can be reliably tracked, detecting the current connection status of Classic Bluetooth devices on Android comes with certain limitations. The Android system provides only limited information about existing connections to Bluetooth devices—especially when those connections were not initiated directly by the app itself.
Android does not offer a reliable API to determine whether a Classic Bluetooth device is currently connected, unless the connection was explicitly established by the app. While system broadcasts like BluetoothDevice.ACTION_ACL_CONNECTED
and BluetoothDevice.ACTION_ACL_DISCONNECTED
do exist, they come with significant limitations:
Not guaranteed: These broadcasts may be suppressed by power-saving mechanisms or system restrictions (e.g., Doze mode, background limitations).
Ephemeral: They are only emitted when the connection state changes and are not retained—an app that starts later cannot reliably reconstruct the current connection state.
If a Bluetooth connection is established outside of the MOVE SDK (e.g., by another app or directly by the system), our Android module cannot reliably detect the actual connection status. This limitation applies only to Classic Bluetooth devices and not to BLE devices.
Imagine the device of a user is already connected via classic Bluetooth with the car. Now the user installs your app with the MOVE SDK included or the necessary Bluetooth permissions were not granted yet.
The app has never received a BluetoothDevice.ACTION_ACL_CONNECTED
or BluetoothDevice.ACTION_ACL_DISCONNECTED
. Now we are in the situation that the app does not know if the (already connected) car is connected or disconnected.
It is possible to force the system to emit BluetoothDevice.ACTION_ACL_CONNECTED
or ACTION_ACL_DISCONNECTED
broadcasts by toggling the Bluetooth state on the device.
For example you can add the following message to the device registration screen in your app:
Please turn Bluetooth off and on again on your smartphone.
This action resets the internal Bluetooth stack and trigger connection status updates, which in turn picked up by your SDK'sBroadcastReceiver
.