Questions tagged [android-ble]

In contrast to Classic Bluetooth, Bluetooth Low Energy (BLE) is designed to provide significantly lower power consumption. This allows Android apps to communicate with BLE devices that have low power requirements, such as proximity sensors, heart rate monitors, fitness devices, and so on.

Here is a summary of key BLE terms and concepts:

Generic Attribute Profile (GATT)—The GATT profile is a general specification for sending and receiving short pieces of data known as "attributes" over a BLE link. All current Low Energy application profiles are based on GATT.

The Bluetooth SIG defines many profiles for Low Energy devices. A profile is a specification for how a device works in a particular application. Note that a device can implement more than one profile. For example, a device could contain a heart rate monitor and a battery level detector.

Attribute Protocol (ATT)—GATT is built on top of the Attribute Protocol (ATT). This is also referred to as GATT/ATT. ATT is optimized to run on BLE devices. To this end, it uses as few bytes as possible. Each attribute is uniquely identified by a Universally Unique Identifier (UUID), which is a standardized 128-bit format for a string ID used to uniquely identify information. The attributes transported by ATT are formatted as characteristics and services.

Characteristic—A characteristic contains a single value and 0-n descriptors that describe the characteristic's value. A characteristic can be thought of as a type, analogous to a class.

Descriptor—Descriptors are defined attributes that describe a characteristic value. For example, a descriptor might specify a human-readable description, an acceptable range for a characteristic's value, or a unit of measure that is specific to a characteristic's value.

Service—A service is a collection of characteristics. For example, you could have a service called "Heart Rate Monitor" that includes characteristics such as "heart rate measurement." You can find a list of existing GATT-based profiles and services on bluetooth.org.

Link

Official documentation

video

sample code

281 questions
1
vote
0 answers

BLE iOS sending data to Android gattServer peripheral:writeValue:forCharacteristic:type not working

I am trying to use android as a BLE peripheral (gatt server). I was able to get it advertising, and I can have the iOS app reeive notifications when certain characteristics are changed, but I am having trouble doing a simple writeValue. On iOS I…
1
vote
1 answer

Android BLE notification limit and the proper way forward. Are multiple BluetoothGatt objects a good way forward?

I am developing a BLE app that connects to custom hardware. The hardware supports notifications on as many characteristics as needed. However android only allows me to enable notifications on 15 characteristics. The only resource I found suggested…
1
vote
1 answer

Bluetooth device not listing in android oreo

BLE devices like ESP 32 is not getting listed while using react-native-ble-manager on android applications with os version > 8 (oreo). The same code works fine with android OS versions < 8 (oreo)
1
vote
2 answers

Android BLE Scan never finds devices

Since a few days I try to implement an BLE connection in my APP. I know that the Device, I try to connect with, is full functional, so the problem must be my code. I use the BluetoothLeScanner.startScan() method. But the callback Method is never…
Proxy
  • 41
  • 1
  • 6
1
vote
1 answer

Android - What API can I use to see if a device supports BLE central mode?

https://developer.android.com/guide/topics/connectivity/bluetooth-le#roles Central vs. peripheral. This applies to the BLE connection itself. The device in the central role scans, looking for advertisement, and the device in the peripheral role…
1
vote
0 answers

Bluetooth-LE GATT write results in notification with same data using RN4020 MLDP protocol

I wonder if anyone else is seeing this. We have successfully used the RN4020 MLDP protocol (similar intent to SPP on Classic Bluetooth) with both iOS and a Bluetooth-LE USB module (BLED112) on Windows. Basically serial bytes coming in to the…
bobwki
  • 794
  • 6
  • 22
1
vote
1 answer

Getting error "E/bt_btif:... ignore HID..." using Android BLE

I'm trying to send data from my wearable device pushing a button to send a value to my phone but when I push the button I get the following error: E/bt_btif: bta_gattc_process_indicate, ignore HID ind/notificiation I'm using the code disposed in…
1
vote
0 answers

Unable to get UUID of a device

I am trying to get UUID, major, and minor of a BLE device and show it in listview, but every single time my parseUUIDs() is returning an empty list. I have tried other methods also, but i'm still not close to it. If someone among you has…
Yousha Arif
  • 1,188
  • 8
  • 20
1
vote
3 answers

onCharacteristicChanged() been called multiple times

I am working with BLE connection in my app. I have a single class for the bluetooth functionalities and I am passing a command from a different fragment class for writing any value. So based on the scenario, inside the fragment, on click of a button…
Animesh Jena
  • 1,541
  • 1
  • 25
  • 44
1
vote
0 answers

BLE onCharacteristicRead receiving status 133

I'm developing a BLE central application (server) and testing it on my Samsung Galaxy S8. The application was working before my phone decided to update (from 7.1.0 to 8.0.0). I'm doing a standard read from a known characteristic / service. The…
wheresmycookie
  • 683
  • 3
  • 16
  • 39
1
vote
1 answer

On start scan BluetoothLeScanner app crashes and no results are displayed

The error message I see is: Attempt to invoke virtual method 'void android.bluetooth.le.BluetoothLeScanner.startScan(java.util.List, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback)' on a null object reference at…
diamantis
  • 21
  • 1
  • 8
1
vote
1 answer

Android BluetoothDevice: obtain paired device type when Bluetooth Low Energy

Here is the problem. The user has run my app previously and discovered and paired with a Bluetooth Low Energy health device. That's all the app works with is health devices. I keep track of that device so the app is able to reconnect automatically…
Brian Reinhold
  • 2,313
  • 3
  • 27
  • 46
1
vote
1 answer

How to sync communication between BLE Central (Mobile) and Peripheral?

I am working on a BLE app. I am through to establishing communication between Mobile app (CENTRAL - BluetoothGattClient) and PERIPHERAL (GATT SERVER) albeit not neatly. PERIPHERAL has one service which in turn has single characteristic on which…
iuq
  • 1,487
  • 1
  • 20
  • 42
1
vote
1 answer

How is nrfConnect able to send more than 20 bytes from android app to raspberrypi?

I am trying to write a 120 byte data through ble to raspberrypi from my android app(I increased the MTU to the required limit). But all I am able to transfer is first 20 bytes. When I tried to search on the internet, I see that android limits the…
tharun
  • 348
  • 6
  • 15
1
vote
1 answer

ScanCall back not Coming in Android Oreo

I am not able to get my ble scanner working.There is no scanCalll Back is occuring. Below is my code: MainActivity: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { …
Raulp
  • 7,758
  • 20
  • 93
  • 155