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
1 answer

Perform an action on Knocking on the phone when the device is asleep?

Im trying to implement a feature that I've seen an few apps, I think for both Android and iOS.. They are calling a function to perform on double knock (tap on the phone) when the app is close and or the screen is locked.. the exact action they were…
Adithya.K
  • 303
  • 2
  • 15
0
votes
0 answers

Android BLE Design Pattern viability

I have looked on numerous topics on android BLE stack in various website. From what i gathered, the bluetooth stack in android is unreliable and not suitable for any fast and concurrent connection. I am currently assigned to a project that uses BLE…
ericlee
  • 2,703
  • 11
  • 43
  • 68
0
votes
1 answer

How to send hex value to BLE device?

I am developing one ble application in which as an input I have to give BLE a hex value as a time parameter so that the device will run for that much time. I have tried everything I know but it is not working. Please help me to get a solution. …
0
votes
1 answer

Read characteristics on ble not called

I am very much new to ble and still trying my hand in it. In my app, I am trying to send a byte array to the ble device and in response, will be recieving a byte array from the device. However onCharacteristicRead() is not called. I know something…
Animesh Jena
  • 1,541
  • 1
  • 25
  • 44
0
votes
1 answer

How to write hex value to BLE device?

I have a BLE device prototype. I am able to scan the device, connect to it. I am also able to write its password as BLE characteristic . Password is in String. But when I am trying to write other values which are in hex it is giving me write…
Pritish
  • 1,284
  • 1
  • 19
  • 42
0
votes
1 answer

Connect A-Frame to BLE devices on any smartphones

I have an application that uses A-Frame to display an animation in "VR". I say "VR" because there is not interaction from the user, I use VR-headset and VR-technologies to focus the user on an animation. The user is passive and will receive stimuli.…
ttben
  • 113
  • 7
0
votes
0 answers

How does command response work in a BLE device?

I am able to connect to a BLE device. Then into the command services Writable Characteristics, I am writing a command. OnCharacteristicsWrite returns the GattStatus as Success as well. Where can I obtain the response to the command?
0
votes
1 answer

Android O : Ble Scanner not scanning - Not getting any scan call back event

I am using google pixel with Android O . I am seeing that in my application after a while there is no scan call back coming . Below is the btif log I have captured 11-02 19:18:20.561 19922-19985/? E/bt_btif: bta_gattc_cache_load: can't open GATT…
Raulp
  • 7,758
  • 20
  • 93
  • 155
0
votes
1 answer

Android BLE- ScanCallBack is never called on BluetoothLeScanner.startScan()

I'm trying to develop a Beacon locator using the BluetoothLeScanner but the problem is that ScanCallBack is never called, to be precise neither of the methods onScanResult, onScanFailed nor onBatchScanResults is called. I have beacon emitter…
0
votes
1 answer

Which Android API issues Scan Request and Responses

Is it Android gatt connect or Android scan(getBluetoothLeScanner) which results in the Scan Request and Response? If we know the BLE Device address , can we directly connect it to without discovering the service?
Raulp
  • 7,758
  • 20
  • 93
  • 155
0
votes
3 answers

BLE writeCharacteristic issue

I'm trying to writeCharacteristic() to a BLE device. I used Google example app to establish the connection, the connection is fine. I can see the BLE Services and the services Characteristics. The writeCharacteristic() method return true and the…
Igor Fridman
  • 1,267
  • 1
  • 16
  • 30
0
votes
1 answer

Application is not able to capture each and every scan responses from the ble device

I am developing a BLE android application where I have used RxAndroidBLe for BLE communication. Everything working fine except one issue that the application is not receiving every scan response broadcasted by the BLE device (I am not sure whether…
sanjay
  • 626
  • 1
  • 7
  • 12
0
votes
1 answer

RxAndroidBle with java 7

I am trying to use RxAndroidBle to scan for devices. All the examples I found seem to use java lambda expression. Do I need java 8 with android studio to use the RxAndroidBle library? How can I run the below code with out lamda…
amanda45
  • 535
  • 10
  • 29
0
votes
1 answer

Detect which BT device is going out of range

Is there a way to check which device among the paired Bluetooth devices is out of range/disconnected? I am able to see that some device is going out of range but need to identify which device is going out of range.
msk
  • 101
  • 1
  • 10
0
votes
1 answer

Is Android Gatt Disconnect Clean?

I am testing my BLE Android App on different Phones ranging from Android 5.0 to 7.1. I am seeing that even though the Disconnection event occur the next BLE connection takes time with intermittent inability to reconnect. Is the Android disconnection…
Raulp
  • 7,758
  • 20
  • 93
  • 155