<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Alex Mitrovic · Blog</title>
<link>https://alexmitrovic.com/blog</link>
<atom:link href="https://alexmitrovic.com/feed.xml" rel="self" type="application/rss+xml"/>
<description>Field notes on Android and iOS apps for Bluetooth Low Energy and IoT devices.</description>
<language>en</language>
<lastBuildDate>Sun, 29 Nov 2026 00:00:00 GMT</lastBuildDate>
<item><title>GATT 133 on Android: why BLE connections fail and how to fix them</title><link>https://alexmitrovic.com/blog/gatt-133-android</link><guid>https://alexmitrovic.com/blog/gatt-133-android</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Connections</category><description>Status 133 is Android's generic GATT_ERROR (0x85): the connection failed and the Bluetooth stack doesn't say why. The most common causes are BluetoothGatt objects that were never closed, connecting without TRANSPORT_LE, and a device that isn't advertising, which ends in a timeout after about 30 seconds. Close every BluetoothGatt after a failure, connect with TRANSPORT_LE, run one connection attempt at a time and retry two or three times with a short delay.</description></item>
<item><title>Android BLE connection drops: what status 8, 19 and 22 mean and how to fix them</title><link>https://alexmitrovic.com/blog/ble-connection-drops-android</link><guid>https://alexmitrovic.com/blog/ble-connection-drops-android</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Connections</category><description>When an Android BLE connection drops, the status in onConnectionStateChange says who ended it: 8 means the link timed out (range, interference or a device reset), 19 means the device disconnected on purpose, and 22 means the phone's own Bluetooth stack ended it, often after a pairing or encryption problem. Close the old BluetoothGatt, then reconnect according to the status instead of with one retry loop for everything.</description></item>
<item><title>Android 12+ Bluetooth permissions: BLUETOOTH_SCAN, CONNECT and location, done right</title><link>https://alexmitrovic.com/blog/android-12-bluetooth-permissions</link><guid>https://alexmitrovic.com/blog/android-12-bluetooth-permissions</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Permissions &amp; scanning</category><description>On Android 12 (API 31) and later, a BLE app requests BLUETOOTH_SCAN to scan and BLUETOOTH_CONNECT to connect; with android:usesPermissionFlags=&quot;neverForLocation&quot; on BLUETOOTH_SCAN it needs no location permission. For Android 11 and earlier it still declares BLUETOOTH and BLUETOOTH_ADMIN with maxSdkVersion 30 and needs ACCESS_FINE_LOCATION to scan, so most apps declare both sets.</description></item>
<item><title>BLE in the background on Android: scanning limits, Doze and foreground services</title><link>https://alexmitrovic.com/blog/android-ble-background-scanning</link><guid>https://alexmitrovic.com/blog/android-ble-background-scanning</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Permissions &amp; scanning</category><description>Android limits background BLE in several layers: more than five scan starts in 30 seconds are throttled, unfiltered scans stop while the screen is off, long scans are downgraded, Doze delays work, and some vendors kill background apps. Use filtered scans, PendingIntent scans or CompanionDeviceManager to find devices, and a foreground service of type connectedDevice to keep a connection alive.</description></item>
<item><title>Why your Android BLE app needs a GATT operation queue (and how to write one in Kotlin)</title><link>https://alexmitrovic.com/blog/ble-gatt-operation-queue</link><guid>https://alexmitrovic.com/blog/ble-gatt-operation-queue</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Connections</category><description>Android's BluetoothGatt can run only one GATT operation at a time per connection: a read, write, descriptor write, MTU request or service discovery started before the previous callback arrived fails (false, or ERROR_GATT_WRITE_REQUEST_BUSY on Android 13+) or is silently lost. A queue that sends one operation, waits for its callback with a timeout and only then sends the next removes a whole class of flaky bugs.</description></item>
<item><title>Android BLE bonding problems: pairing loops, stale bonds and how to recover</title><link>https://alexmitrovic.com/blog/android-ble-bonding-problems</link><guid>https://alexmitrovic.com/blog/android-ble-bonding-problems</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Pairing &amp; security</category><description>Most BLE bonding problems come from three things: the app doing GATT operations while bonding is still in progress, a device that pairs without storing keys so users are asked every time, and stale bonds where a reset device forgot its keys but the phone didn't. Wait for BOND_BONDED before continuing, agree the bonding rules with the firmware team, and design a recovery path for reset devices.</description></item>
<item><title>BLE MTU and throughput: why your transfers are slow and what to change</title><link>https://alexmitrovic.com/blog/ble-mtu-throughput</link><guid>https://alexmitrovic.com/blog/ble-mtu-throughput</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Throughput &amp; OTA</category><description>BLE throughput depends on six settings working together: write type, link-layer packet size (Data Length Extension), ATT MTU, PHY, connection interval and how many packets the phone fits into each connection event. The biggest gains usually come from writing without response with flow control, enabling DLE with an MTU of 247, and using 2M PHY during transfers.</description></item>
<item><title>Why BLE firmware updates fail (OTA and DFU), and how to make them finish</title><link>https://alexmitrovic.com/blog/ble-ota-firmware-update-fails</link><guid>https://alexmitrovic.com/blog/ble-ota-firmware-update-fails</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Throughput &amp; OTA</category><description>BLE firmware updates usually fail for a handful of reasons: the connection drops mid-transfer and the update can't resume, the app writes slowly and users give up, the OS suspends the app in the background, the device reboots into a bootloader the app can't find, or a stale GATT cache hides the new services. A reliable update resumes from the last confirmed offset, lets the device verify the image before switching, and handles the bootloader restart explicitly.</description></item>
<item><title>Wi-Fi provisioning over BLE: getting IoT devices online without losing users</title><link>https://alexmitrovic.com/blog/wifi-provisioning-over-ble</link><guid>https://alexmitrovic.com/blog/wifi-provisioning-over-ble</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Wi-Fi &amp; IoT</category><description>For most IoT devices, provisioning Wi-Fi over BLE is the smoother option: the phone stays on its own network, the device scans for Wi-Fi networks and sends the list over BLE, the app sends the chosen network's credentials encrypted, and the device reports each step (connecting, got IP, cloud reached) back over BLE so the app can confirm success or show the exact reason it failed.</description></item>
<item><title>CoreBluetooth state restoration: keeping an iOS BLE app connected in the background</title><link>https://alexmitrovic.com/blog/corebluetooth-state-restoration</link><guid>https://alexmitrovic.com/blog/corebluetooth-state-restoration</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>iOS &amp; KMP</category><description>To keep an iOS BLE app working in the background, enable the bluetooth-central background mode, create the CBCentralManager with a restore identifier, implement centralManager(_:willRestoreState:) to take back the restored peripherals, and use pending connect() calls, which never time out, to reconnect. iOS then relaunches the app in the background for Bluetooth events even after it was terminated for memory, but not after the user force-quits it.</description></item>
<item><title>Kotlin Multiplatform for BLE apps: what to share and what to keep native</title><link>https://alexmitrovic.com/blog/kotlin-multiplatform-ble</link><guid>https://alexmitrovic.com/blog/kotlin-multiplatform-ble</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>iOS &amp; KMP</category><description>In a Kotlin Multiplatform BLE app, share the parts that must behave the same on Android and iOS: the device protocol (framing, parsing, checksums, OTA chunking), the connection state machine, retry policy and device state, behind a small BleLink interface. Implement that interface natively on each platform over BluetoothGatt and CoreBluetooth, because their threading, pairing and background rules really differ.</description></item>
<item><title>How to test a BLE app on real phones: the device matrix, HCI logs and field logging</title><link>https://alexmitrovic.com/blog/testing-ble-apps-on-real-phones</link><guid>https://alexmitrovic.com/blog/testing-ble-apps-on-real-phones</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Testing &amp; hiring</category><description>Test a BLE app on the phone brands and OS versions your users actually have, not only the team's phones; run the scenarios that break BLE apps (walking out of range, locking the phone, killing the app, toggling Bluetooth, resetting the device); and capture HCI snoop logs on Android or PacketLogger traces on iOS when something fails, so you can see what the radio did instead of guessing.</description></item>
<item><title>BLE vs Wi-Fi vs MQTT for an IoT app: which link to use, and when to combine them</title><link>https://alexmitrovic.com/blog/ble-vs-wifi-vs-mqtt-iot-app</link><guid>https://alexmitrovic.com/blog/ble-vs-wifi-vs-mqtt-iot-app</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Wi-Fi &amp; IoT</category><description>Use BLE for setup and for control when the phone is near the device and battery life matters; Wi-Fi on the local network for fast, frequent control at home without the cloud; and MQTT through a cloud broker for control and state when the phone is away from home. Most successful connected products combine them: BLE for onboarding, Wi-Fi or MQTT for everyday use.</description></item>
<item><title>How to hire a BLE app developer: 10 questions that separate specialists from generalists</title><link>https://alexmitrovic.com/blog/how-to-hire-a-ble-developer</link><guid>https://alexmitrovic.com/blog/how-to-hire-a-ble-developer</guid><pubDate>Sun, 29 Nov 2026 08:00:00 GMT</pubDate><category>Testing &amp; hiring</category><description>To hire a BLE app developer, ask how they would debug a connection that fails only on some phones, what they do after status 133, how they queue GATT operations, handle bonding and background limits, make OTA resumable and test on real phones. A specialist answers with specific mechanisms and tools; a generalist answers with retries and delays. Then start with a small paid task, such as an audit or one bug.</description></item>
</channel>
</rss>
