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

Android: connect multiple BLE devices without using third party libraries

I am working on Android BLE Devices. Right now, I am trying to keep state connected of two BLE devices(eg. two Scales devices or Activity Sensor devices). Well, I know I can do that by using multiple services where each service contains different…
Aanal Shah
  • 1,946
  • 2
  • 20
  • 30
1
vote
1 answer

RxAndroidBle - How to disconnect all connected devices?

I am using awesome rxandroidble library for BLE control. I keep connection between activities. Before I start scanning, I want to disconnect all connected devices first. Sometimes It is not working if there are many connections. This is the…
mudin
  • 2,672
  • 2
  • 17
  • 45
1
vote
1 answer

How to initialize BluetoothGatt object in BLE?

While looking at all examples all I see is to initialize BluetoothGatt object the way used is mGatt = device.connectGatt(activity, false, gattClientCallback); Now how do I initialize the gatt object without connecting the device. I have a…
Pritish
  • 1,284
  • 1
  • 19
  • 42
1
vote
4 answers

ScanCallback onBatchScanResults is getting called indefinitly

I am trying to scan for BLE devices once I find my device or after 10 sec, I am trying to stop the scan. But for some reason the onBatchScanResults is getting called indefinitely. I found that even after stopping the scan the onBatchScanResults…
1
vote
1 answer

Determine Characteristic Notfication emission count by first emission

I am currently implementing a protocol for a Bluetooth device and i am using the RxAndroidBle Library (version 1.4.3). I have to request data from the device by writing to characteristic and then listening to the response via a characteristic…
tiqz
  • 147
  • 1
  • 2
  • 8
1
vote
1 answer

Trouble Connecting Android App to Raspberry Pi 3 over BLE

I am using the Raspberry Pi 3 model B as a bluetooth peripheral. The Pi is running a GATT server and advertising it as well. I can connect to it from the LightBlue iOS app and can read and write values. I am having trouble connecting to the Pi over…
1
vote
1 answer

Missing value for RR-interval (BLE / Polar device)

I'm owning a Polar H10 device and I'm interested in the heart rate as well as RR-interval which I read out with the official bluetooth low energy API of Android. The Polar device sends every every second a package with the heart rate and the…
machinery
  • 5,972
  • 12
  • 67
  • 118
1
vote
0 answers

BLE Device disconnect event delay

I have a problem with BLEdevice - android BLE stack does not reports about its disconnect for about 15 seconds after device was disbled. Actual disconnect event appears on timeout, as I can see. Is there any way to notify android that device…
Raiv
  • 5,731
  • 1
  • 33
  • 51
1
vote
1 answer

android maximum regions to ranging and monitoring

I want to track all nearby beacons using global region, then i create individual region for each ranged region from the global region, is there any regions limit for android phone ? i've read that in the ios regions are limited into 20 max. Any help…
1
vote
5 answers

BLE Device dissonect after receive Notifications (BLEGattException Status = 0x8)

My BLE server permanently measures a sensor value and sends a notification with 20 byte user data after each measurement. The goal is to generate as much throughput as possible. On the client side, the value sent by the server is received and…
1
vote
1 answer

Android BLE Peripheral Mode: custom characteristics not detected

I am trying to implement a BluetoothGattServer on a Sony SmartWatch 3. I can sucessfully open a Gatt server as well as advertise. Using the BLE Scanner application, I have inconsistent results while discovering my custom services and its custom…
1
vote
1 answer

GATT_REQUEST_NOT_SUPPORTED any more information available?

I am writing an android app to communicate with a BLE device. The app is a recreation of an iOS version however any write request raises a GATT_REQUEST_NOT_SUPPORTED response inside onCharacteristicWrite WORKING Objective C Code const uint8_t…
1
vote
0 answers

OnErrorNotImplementedException somehow still being called with included error handling

Im performing a write to a BLE characteristic, where with these specific devices certain characteristics are not writeable if the peripheral is still locked. I'd like to simply provide a visual notification if this is called while the device is…
Orbit
  • 2,985
  • 9
  • 49
  • 106
1
vote
2 answers

Emit an item one at a time, interact with it until a condition is met, then continue for next item

I have a list of BLE devices, and am using RxJava to interact with them. I need to emit an item from the list, write a characteristic to it repeatedly until X happens, and then proceed to the next item in the list. Current…
Orbit
  • 2,985
  • 9
  • 49
  • 106
1
vote
2 answers

How to disable a notification with rxandroidble?

I'm currently trying to use rxandroidble in order to replace the native BLE API of Android of one of our app. How to disable a notification? I'm able to enable it with the sample code, this one: device.establishConnection(context,…
Myx
  • 175
  • 1
  • 11