# Android BLE guide: permissions to OTA, in order · Alex Mitrovic
URL: https://alexmitrovic.com/android-ble-guide
Last updated: 2026-11-30

> A practical Android BLE guide: permissions, scanning, connecting, GATT 133, the operation queue, bonding, MTU, OTA and testing, in the order you hit them.

Guide

# The Android BLE field guide

Every BLE article on this site, in the order you run into the problems: from the permission prompt to the last byte of a firmware update. Code is Kotlin and tested on real phones. iOS notes where they differ.

[Start with permissions](https://alexmitrovic.com/blog/android-12-bluetooth-permissions)[Use the free tools](https://alexmitrovic.com/tools)

Short answer

## How do you build a reliable BLE app on Android?

Get permissions and scanning right for each Android version, run every GATT operation through one queue, close every BluetoothGatt you're done with, handle disconnect statuses and bonding explicitly, tune MTU and connection parameters with the firmware team, make OTA updates resumable, and test on the phone brands your users actually have.

Part 1

## Before the first connection

Permissions and scanning decide whether the app ever sees the device.

[Permissions & scanning ### Android 12+ Bluetooth permissions: BLUETOOTH_SCAN, CONNECT and location, done right On Android 12 (API 31) and later, a BLE app requests BLUETOOTH_SCAN to scan and BLUETOOTH_CONNECT to connect; with android:usesPermissionFlags="neverForLocation" on BLUETOOTH_SCAN…](https://alexmitrovic.com/blog/android-12-bluetooth-permissions)

[Permissions & scanning ### BLE in the background on Android: scanning limits, Doze and foreground services 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,…](https://alexmitrovic.com/blog/android-ble-background-scanning)

Part 2

## Connecting and staying connected

The failures that fill bug trackers: 133 on connect, drops later, and operations that collide.

[Connections ### GATT 133 on Android: why BLE connections fail and how to fix them 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…](https://alexmitrovic.com/blog/gatt-133-android)

[Connections ### Android BLE connection drops: what status 8, 19 and 22 mean and how to fix them 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…](https://alexmitrovic.com/blog/ble-connection-drops-android)

[Connections ### Why your Android BLE app needs a GATT operation queue (and how to write one in Kotlin) 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…](https://alexmitrovic.com/blog/ble-gatt-operation-queue)

Part 3

## Pairing, data and speed

Bonds that break, and transfers that use a fraction of what the link can carry.

[Pairing & security ### Android BLE bonding problems: pairing loops, stale bonds and how to recover 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…](https://alexmitrovic.com/blog/android-ble-bonding-problems)

[Throughput & OTA ### BLE MTU and throughput: why your transfers are slow and what to change 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…](https://alexmitrovic.com/blog/ble-mtu-throughput)

Part 4

## Updates and setup

Firmware updates that finish, and getting a device onto Wi-Fi.

[Throughput & OTA ### Why BLE firmware updates fail (OTA and DFU), and how to make them finish 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…](https://alexmitrovic.com/blog/ble-ota-firmware-update-fails)

[Wi-Fi & IoT ### Wi-Fi provisioning over BLE: getting IoT devices online without losing users 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…](https://alexmitrovic.com/blog/wifi-provisioning-over-ble)

Part 5

## Both platforms

iOS background behavior, and sharing the BLE layer between Android and iOS.

[iOS & KMP ### CoreBluetooth state restoration: keeping an iOS BLE app connected in the background To keep an iOS BLE app working in the background, enable the bluetooth-central background mode, create the CBCentralManager with a restore identifier, implement…](https://alexmitrovic.com/blog/corebluetooth-state-restoration)

[iOS & KMP ### Kotlin Multiplatform for BLE apps: what to share and what to keep native 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…](https://alexmitrovic.com/blog/kotlin-multiplatform-ble)

Part 6

## Testing and choosing

How to test on the phones your users have, and which link to pick for an IoT product.

[Testing & hiring ### How to test a BLE app on real phones: the device matrix, HCI logs and field logging 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…](https://alexmitrovic.com/blog/testing-ble-apps-on-real-phones)

[Wi-Fi & IoT ### BLE vs Wi-Fi vs MQTT for an IoT app: which link to use, and when to combine them 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…](https://alexmitrovic.com/blog/ble-vs-wifi-vs-mqtt-iot-app)

[Testing & hiring ### How to hire a BLE app developer: 10 questions that separate specialists from generalists 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…](https://alexmitrovic.com/blog/how-to-hire-a-ble-developer)

Reference

## Keep these open while you debug

[Tool ### GATT status code lookup Look up any Android BLE GATT or HCI status code (133, 8, 19, 22, 62, 0x3D): what it means on Android and what to check first.](https://alexmitrovic.com/tools/gatt-status-codes)

[Tool ### BLE throughput calculator Estimate BLE throughput from MTU, Data Length Extension, PHY, connection interval and packets per event, and how long a firmware update takes.](https://alexmitrovic.com/tools/ble-throughput-calculator)

[Tool ### Android BLE permissions generator Generate the AndroidManifest Bluetooth permissions and runtime request code for your minSdk and targetSdk, including neverForLocation.](https://alexmitrovic.com/tools/android-ble-permissions)

[Guide ### BLE glossary 35 Bluetooth Low Energy terms explained in one or two sentences for app developers: GATT, ATT MTU, CCCD, bonding, DLE, PHY, autoConnect, state restoration.](https://alexmitrovic.com/ble-glossary)

## Rather have someone fix it?

The BLE reliability audit finds what's wrong with your app's BLE layer on real phones, in about a week, at a fixed price.

[See the audit](https://alexmitrovic.com/services/ble-reliability-audit)

Free · NDA on request · reply within 1–2 working days
