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
0
votes
0 answers

React Native Android 12 Permission, Ble cannot scan

On Android 12 or higher Ble cannot scan. My android.manifest is below:
0
votes
0 answers

Custom services not showing up on Android app Post

I have the Adafruit Feather M0 Bluefruit LE. I'm encountering the same issue as these two posts: https://forums.adafruit.com/viewtopic.php?t=122349 https://forums.adafruit.com/viewtopic.php?f=22&t=155690 I created a custom BLE GATT service on the…
Amy
  • 1
  • 1
0
votes
1 answer

RxAndroidBle waiting for response from peripheral when write on it (not long write) in Kotlin

I am trying to write to a peripheral in Android Kotlin using RxAndroidBle. The application writes to the peripheral and then the peripheral responds if this write request is successful, i.e. According to the evaluation made of the information sent…
FABiO
  • 92
  • 8
0
votes
1 answer

BLE android read readCharacteristic

I Try to devlope android app to read from cycling sensor , if anyone can help plz . its connect to the sensor but cant read the characteristic. i dont know how to read the characterestic value . its a speed sensor sor i want to be notify or read (i…
0
votes
0 answers

Trying to update already existing SharedPreferences values

I am trying to save a name in SharedPreferences. The app is set up so that it recognizes devices by their MAC address. There's an EditText view that populates with the advertised name of the BLE peripheral, and then the user can alter the name…
gpeck
  • 39
  • 6
0
votes
1 answer

onPhyUpdate is triggered with status 6 = GATT_REQUEST_NOT_SUPPORTED

I'm developing an Android app which communicates via BLE with an external module, and I am trying to set the BLE connection PHY. I've tried calling the method gatt.setPreferredPhy(txPhy, rxPhy, phyOptions) with all the different phy type integer…
0
votes
1 answer

Do you have to instantiate a Kotlin object?

I am working on an Android Studio project where I am using a singleton class to keep track of data (I have already done research on the pros and cons of singleton objects, and I decided it was the best solution for my project). I am, however,…
gpeck
  • 39
  • 6
0
votes
1 answer

NRF52 java unsigned byte issue

I am using ble with nrf52 and sending a byte array command from android with java like below byte[] header=new byte[]{ (byte )0x5f, (byte) 0xf0, (byte) 0xf1, (byte) 0xf2, }; when I log these bytes…
Ali güvenç
  • 147
  • 1
  • 6
0
votes
0 answers

BLE writing to a characteristic (Android Studio)

I'm developing an Android app using Android Studio. The app relies heavily on BLE (Bluetooth Low Energy), and the basic idea is that when a button is pressed, it will turn on a fan connected to an Arduino board. I'm pretty sure that I have the…
Dave
  • 1
  • 1
0
votes
1 answer

Handling Notifications on Android with Multiple BLE Peripheral Connections

So, I am new to Android development and I am trying to connect my device to multiple BLE devices (T-Wristband) to receive frequent notifications (IMU sensor data less than 20 bytes at 50Hz). When connecting to multiple devices, I miss data from one…
0
votes
1 answer

BLE packet drops when Bluetooth and BLE are simultaneously in use

I am using BLE v4.1 for my application where I am able to transfer 200 packets of length 20 bytes each from peripheral to central side. I want to transfer data via BLE and play some music while the data is being transferred. The music file is…
0
votes
1 answer

How to implement a custom UUID for bluetooth broadcast

I want to change my android device's Bluetooth UUID to a predefined value so that my BLE beacon can recognize it without pairing with it. From this question I gathered that I'll have to change the service UUID but I can't find the relevant documents…
kk_cc
  • 45
  • 4
0
votes
1 answer

BLE disconnected with status 8, interval 36

When trying to connect to Raspberry Pi BLE GATT server (using hardcoded BT address) from Android app, most of the times (not always) I'm getting: D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=
D/BluetoothGatt:…
ihaqra
  • 1
  • 1
0
votes
0 answers

Android BLE onCharacteristicChanged is not called on second time

What I am trying to do: I am building an android ble application which will connect to IOT devices and when sending command it will return with some responses. For example when sending "STATUS" it will return with "STATUS OK" What is being…
0
votes
1 answer

Google Fit api BLE connect issue

I want to connect Mi Band 3 with my application through Google Fit SDK. I am facing issue to connect band through bluetooh. as given in Offical Google Fit Documentation - BLE Sensor I am using following code in Kotlin var bleScanCallbacks:…