Companion apps usually run late for the same reason: the app and the device were each correct on their own, and nobody wrote down exactly how they should talk. In our published connected-device projects the hardware and firmware were the client’s and the software was ours, so this boundary is where we spend our time. This is what we ask for first.
The protocol document
A short written document saves weeks. It should list:
- Services and characteristics: the UUIDs, and whether each one is read, write, write without response, notify or indicate.
- Message formats: byte order, units, scaling and what each field means. Include one worked example with real bytes.
- Version information: how the app learns which firmware version it is talking to, and how older versions behave.
- Error behaviour: what the device sends when something fails.
If it does not exist yet, that is fine. Writing it together is often the first useful task.
Test hardware
- At least two working devices, ideally three. Some problems only appear when more than one device is nearby.
- A way to put a device into known states: low battery, full memory, mid-update.
- Older firmware versions, if devices are already in customers’ hands.
- A contact on the firmware team who can answer questions within a day or so.
Decisions that cross the boundary
Pairing and security. Is the link encrypted and bonded? How does a user claim a device? What happens when the phone or device is reset, or the device is sold on?
Reconnection. Phones sleep, users walk away, Android and iOS both limit background work. Decide what should happen in each case, then test it. This is usually the largest source of complaints from real users.
Large data. Bluetooth packets are small: 20 bytes of data by default, more after the phone and device negotiate a larger size, and the result varies by phone. For anything bigger, agree how it is split, how much fits in each write, how the far side confirms it, and what happens when a piece goes missing. Within a connection Bluetooth delivers packets in order, so most problems come from elsewhere: a full buffer on either side, a dropped connection mid-transfer, and data sent twice when a transfer resumes. Sequence numbers and a resume point handle all three.
Stored data. If the device records while out of range, how does the app know what is new? How are sessions numbered? When can the device delete its copy? What if the sync stops halfway?
Time. Does the device have a clock? Who sets it? Readings stored with the wrong time are very hard to fix later.
Firmware updates. Which method? A checksum catches a damaged transfer, but only a signature stops someone loading the wrong firmware. Does the device keep the old image until the new one has started successfully? What happens if the phone dies at 80%? Can a failed device recover by itself? An update that can leave a device unusable deserves more testing than anything else in the app.
iOS and Android differ
Plan for these from the start:
- iOS hides the Bluetooth address and gives your app its own identifier for each device, which differs from phone to phone. Android gives you the address the device uses, which may be a random one. Put a device ID in your protocol, and do not build identity on the address.
- Android phones vary in how they handle connections and packet sizes, so test on several manufacturers.
- Both platforms need permissions explained to the user, and the rules have changed across OS versions.
- Background behaviour differs a great deal. Decide what must work in the background, and accept what cannot. On iOS, an app the user has swiped away will not reconnect until it is opened again. On Android, long connections need a visible foreground service, and some manufacturers still stop it.
If Bluetooth is one feature among many, Flutter works well, with native Kotlin or Swift bridges where a plugin falls short. If the device is the product, with long background connections or firmware updates, we usually recommend native. We test on the real device wherever you can supply one.
Who does what
Write down who owns each of these: the protocol document, the firmware fixes, the app, the server, certification (including Bluetooth qualification and radio approvals) and store listings. Apps for hardware often touch regulated areas, health in particular, and those decisions belong with you and your advisers.
A good first step
Start with a small app that connects, reads one value, writes one setting and survives a reconnect. It proves the protocol works, it exposes misunderstandings early, and it costs far less than finding them at the end.
If you have a device and need the app, tell us about it. Our wearable sensor case study shows this work on iPhone, Apple Watch and Android, including firmware updates from the app, and our load sensor apps are another Bluetooth example. Our connected-device page lists all four connected products.