Bluetooth and the UX

Why you want to think about the user experience before tackling GATT design

Bluetooth adds some unique constraints and challenges to an app user experience. It helps to understand these so the right communication protocol can be created.

Let's take the example of an app that needs to keep connected in the background and ensure that it receives periodic data from a health device.

Let's say the user opens the app, connects to the device, puts the phone in their pocket, and the app & device keep talking to each other.

So far, so good.

What happens when the user walks away from the device?

The app will need to scan for the device and reconnect once it comes back in range.

Here is the gotcha - both Android and iOS require a scan filter when scanning in the background. This scan filter is a GATT service UUID that the device must be advertising.

If the device does not advertise a service UUID for the app to filter - background scanning and connecting will not work consistently.

An important detail: The advertisement parameter to set is 0x07 'Service Class', as opposed to 0x21 which is 'Service Data'