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

Android BLE: Message Length issue

I am developing an android application with BLE. The requirement of this application is to update the voltage variation in a specific hardware with various inputs. So I am writing the characters to the BLE as 8-bit input. Each bit value contains…
Nithinjith
  • 1,775
  • 18
  • 40
0
votes
0 answers

How to transmit beacon using altbeacon

I am working on Android app to transmit data by custom beacon, here is my code : public void transmitData() { mBeaconTransmitter = new BeaconTransmitter(this, new BeaconParser().setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24")); …
user
  • 471
  • 2
  • 16
  • 31
0
votes
1 answer

How to search custom/manufacturer specific beacon using Altbeacon Android library

I am working on Android trying to search/find beacons nearby and I am using Altbeacon Android library. The beacon is custom and here is the manufacturer specific: //---------------flags data type------------------------------------------------ //…
user
  • 471
  • 2
  • 16
  • 31
0
votes
1 answer

What services and characteristic must use to send data over BLE in android?

I develop a Android app to send data to BLE device. When i connecto to BLE device, i discovered services and characteristics and get this onGetService() - Device=D8:80:39:F0:03:6E UUID=00001800-0000-1000-8000-00805f9b34fb onGetService() -…
0
votes
0 answers

Losing BluetoothGatt objetct of BLE connection

I'm developing an APP that connect to a BLEDevice. This connection is managed by a Sticky Service that have a instance of a singleton that keep all the parameters of the BLE connection (BluetoothDevice,BluetoothGatt,BluetoothGattCallBack). The…
SamuelPS
  • 555
  • 6
  • 20
0
votes
1 answer

How to detect active connection from bluetooth device using Android SDK

I am working on an Android app that uses a bluetooth connection, and I want to read data from the device into the app, but need to know if I am connected to the device before reading data. Below is the code I have that launches bluetooth settings…
user3316012
  • 97
  • 1
  • 6
0
votes
1 answer

Save a list of discoverable bluetooth LE devices?

How can I save a list of discoverable BLE devices in Android? Follow my implementation of startDeviceScan() method: private String[][] mNearestDevices; // ... public String[][] startDeviceScan() { Log.i(TAG, "Start device scan"); …
eldivino87
  • 1,425
  • 1
  • 17
  • 30
0
votes
1 answer

Stop BLE scan started in runnable

I am developing an app in which I will be searching for available beacons in range continuously, when the user displays a certain fragment of the app. In order to do this I created a Runnable in which i call a method which starts a scan. Scan…
fragon
  • 3,391
  • 10
  • 39
  • 76
0
votes
1 answer

service and three activity, start service is the right way?

I developed a Ble Android App composed from three activity and one service: - the first one to scan the device - the second one to connect to device - the third one to write communication result on the screen - inside the service there are some…
0
votes
0 answers

Android BLE - Ring, Vibrate, and Write characteristic according to RSSI value

I am new to Android and Java and I don't want to give up yet. I am using the Android Studio sample for BLE for this project. https://github.com/googlesamples/android-BluetoothLeGatt If there is any sample code that is relevant for my purpose, and…
0
votes
1 answer

How to use the Bluetooth Low Energy Services?

Want to build a chat app that can only communicate with BLE supported devices. How to initialize the BLE service and how to pair with a device so that it can receive messages.
Ryan
  • 1
  • 1
0
votes
1 answer

Android: BLE device is sending packet time is slow and get only max 20 byte at a time

I am developing health application so use BLE device(Hardware). From BLE Device send 25 byte at one packet but on mobile(Android) side we receive 20 byte. (I am refer this link) When receiving each packet send acknowledgement to BLE device. But…
0
votes
1 answer

Gimbal "BeaconSighting" listener working erratically

I am trying to obtain the Gimbal beacon distance changes run-time in Android. I am able to connect to my beacon and same is reflected in the android app. But I am not able to obtain the changed RSSI in the app. Below is my code. private…
BlueSword
  • 1,290
  • 12
  • 25
0
votes
0 answers

How to play from Byte[] in media player ? Byte[] consists of Heart Beat Sound data

How to play the Byte[] in media player where data is coming from Doppler(BLE device for Heart Beat Sound). Data is in this form: [85, -86, 9, -96, 53, 50, 24, -86, -103, -65, -72, 36, 67, 24, -102, -103, -103, -102, -67, -87, 55, 115, 24, 8, -22,…
0
votes
0 answers

Android: How Do BLE Notifications Work?

On Android when you want to receive BLE notifications for characteristic changes you use something like the following: BluetoothGattCharacteristic characteristic = ... gatt.setCharacteristicNotification(characteristic, true); BluetoothGattDescriptor…
SuperDeclarative
  • 1,609
  • 4
  • 18
  • 32
1 2 3
18
19