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

How to check if a bluetooth response is received within a particular time limit?

I'm developing an app bluetooth to communicate with a device. I have to send to that device a certain packet and that device respond to me in notify mode after a certain time. All works well, but I have to check if the response arrive to me in 3…
aeroxr1
  • 1,014
  • 1
  • 14
  • 36
0
votes
0 answers

BLE (Bluetooth Low Energy) not able to find another BLE device

I am trying to scan another BLE device, but it is not finding another BLE device. Instead, it scanned a Bluetooth device with api <18. This is my code : package com.example.blescan; import java.util.ArrayList; import android.app.Activity; import…
Harsh Parikh
  • 3,845
  • 3
  • 14
  • 14
0
votes
0 answers

How will i show values received from a ble device continuously on multiple textviews

I am developing an app for humidity sensor. the sensor will send data to the app continuously every second. I need to show it on multiple textviews with an update every second. Currently, My receiving part code is @Override public void…
Mr Robot
  • 1,747
  • 6
  • 35
  • 67
0
votes
1 answer

How will i Split a String that received from a ble device for if else checking and display a value on Textview

In my Android app I receive data from my ble device as something like 10100201201511 ( it includes date,time and other attributes). I hope I received it as a string, I want to check that value and display it on textview. My Requirement is If…
Mr Robot
  • 1,747
  • 6
  • 35
  • 67
0
votes
1 answer

How to show data from a BLE device in multiple Textviews?

I have a humidity sensor that broadcasts the last ten values as a single array after a fixed time interval. I want to display these values in ten Textview's. My current code displays all the values in a single TextView, how can I modify this? How…
Mr Robot
  • 1,747
  • 6
  • 35
  • 67
-1
votes
1 answer

Bluetooth BLE onCharacteristicRead() gives Status= 128

When i am trying to read characteristic using readCharacteristic() it giving me true but when i am getting response in onCharacteristicRead() it giving me status = 128 instead of status=0 (BluetoothGatt.GATT_SUCCESS) Can any one help me or…
-1
votes
1 answer

It leaks when I startLeScan in onCreate and stopLeScan in onDestroy

I run my code and rotate the phone couple of times, then dump memory and analyze it. Below is my code: private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void…
tiny sunlight
  • 6,231
  • 3
  • 21
  • 42
-2
votes
1 answer

Nearby scan in foreground service

My android app needs to find a beacon in background. To do so I'm using the google nearby messaging api with beaconId. To have a scan in foreground I'm subscribing the messages client in a foreground service, but my app after some times stops seeing…
-2
votes
1 answer

How to maintain more than 7 active BLE connections on android device

I am trying to get about 50 devices to connect to my android tablet and have them actively send notification to the android tablet anytime there is something to notify. To receive notifications I am assuming I need to maintain an active connection…
-3
votes
1 answer

ANDROID BLE WRITE DATA

I currently working on android app, i wan to add BLE application in to my app, that is , i wanna send data into nrf51822/8001. Please provide me a simple example. Thank you.
Nufail Achath
  • 58
  • 1
  • 7
-3
votes
2 answers

Android : auto connect to heartrate sensor ble

I have developed an app that connect to a Polar heart monitor. I connect to it using : device.connectGatt(this, false, mGattCallback); and If I lost the connection I rescan the device and I reconnect to the same hear monitor. I wonder if I can…
aeroxr1
  • 1,014
  • 1
  • 14
  • 36
1 2 3
18
19