Questions tagged [android-bluetooth]

The Android bluetooth subsystem. May also refer to using bluetooth hardware in Android.

The Android bluetooth subsystem. May also refer to using bluetooth hardware in Android.

See the official Android Bluetooth guide for an introduction and API docs.

2111 questions
20
votes
1 answer

Bluetooth protocol (RFCOMM, L2CAP and ACL)

From what I've read from Bluetooth Essentials for Programmers, this books mentions some points that I dont quite understand. RFCOMM is a reliable stream-based protocol. L2CAP is a packet-based protocol that can be configured with varying levels…
Sam
  • 4,521
  • 13
  • 46
  • 81
20
votes
3 answers

How to capture key events from bluetooth headset with android

My app can be controlled by normal headset. It simply overrides "onKeyDown". But key events from bluetooth headset are not captured - why? Or how to capture bluetooth key events? the "log cat" shows the following if i press button on…
dermoritz
  • 12,519
  • 25
  • 97
  • 185
18
votes
2 answers

Android BLE- How is onScanResult method being called in ScanCallback?

This is my first time doing Bluetooth Low Energy in Android project. The project that I am doing is basically to detect all Bluetooth LE devices and connect them to discover their services. I would like to ask if anyone know how onScanResult(),…
janice chau
  • 475
  • 1
  • 3
  • 13
17
votes
0 answers

How to reliably fetch and detect changes to the active audio route on Android?

I have a feature where I need to fetch current AND detect switch of the active audio output device of the system. Something like: run app -> fetch current device (which might be embedded speakers) connect bluetooth speaker -> detect switch to…
17
votes
2 answers

Authentication issue in BLE Bluetooth Low Energy device

We are making a IOT device with a BLE interface which uses the HM-11 (http://www.seeedstudio.com/wiki/Bluetooth_V4.0_HM-11_BLE_Module) breakout board hosting the chip CC2541 (http://www.ti.com/product/CC2541). The authentication method is set to…
JV.
  • 2,658
  • 4
  • 24
  • 36
17
votes
3 answers

Robustly communicating with multiple BLE devices simultaneously on Android

Although undocumented, conventional wisdom using the Android BLE apis is that certain operations like reading / writing Characteristics & Descriptors should be done one at a time (although some devices are more lenient than others). However, I am…
sonorangoose
  • 201
  • 2
  • 5
17
votes
1 answer

What is "reliable write" in BLE?

In Android's BLE API (BluetoothGatt) there are methods that deal with reliable writes: public boolean beginReliableWrite () public void abortReliableWrite (BluetoothDevice mDevice) public boolean executeReliableWrite () There is also a Callback…
Manuel M
  • 809
  • 1
  • 10
  • 25
17
votes
3 answers

Bluetooth Low Energy Connection Parameters for Android, iOS and Win8

I've been looking all over the place for the required bluetooth connection parameters that will work for all three of these operating platforms. I'm using the HOGP (Bluetooth over HID GATT) profile for this project. My project is an embedded system…
17
votes
4 answers

BlueZ vs Bluedroid bluetooth stack

BlueZ have a lot of documentations and all. And from the same, i understood BlueZ supports A2DP sink support. And at the same time an android device can be made act as an A2DP sink by modifying the audio.conf file inside the same. I also came to…
Nidhin Joseph
  • 1,461
  • 3
  • 15
  • 32
17
votes
5 answers

java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission

Has anyone meet the same problem as the following error message shows when calling bluetoothDeive.createBond() method with android 4.4 api? java.lang.SecurityException: Need BLUETOOTH PRIVILEGED permission Note: BLUETOOTH_ADMIN permission is…
user2822074
  • 171
  • 1
  • 1
  • 4
17
votes
2 answers

Find already paired bluetooth devices automatically, when they are in range

I am no Bluetooth specialist and wondering what possibilities are available to find already paired Bluetooth devices automatically when they are range of each other. Background: In our case an Android application needs to connect to a dedicated…
mheymel
  • 209
  • 3
  • 7
16
votes
1 answer

How to keep Bluetooth connection background?

I have created a Bluetooth Activity class in the android app, which works fine for all the Bluetooth functionalities like: scanning, pairing, connecting, sending and receiving data. The real problem is when the Activity is destroyed. Bluetooth is…
16
votes
4 answers

Android BLE device scan with filter is not working

I am working with android BLE (Bluetooth Low Energy). I am having trouble in scanning BLE device using startLeScan(UUID[] serviceUuids, BluetoothAdapter.LeScanCallback callback) method while startLeScan(BluetoothAdapter.LeScanCallback callback) is…
16
votes
3 answers

Android bluetooth get connected devices

How can I get a list of all connected bluetooth devices for Android regardless of profile? Alternatively, I see that you can get all connected devices for a specific profile via BluetoothManager.getConnectedDevices. And I guess I could see which…
Steven Wexler
  • 16,589
  • 8
  • 53
  • 80
15
votes
2 answers

How print invoice receipt using bluetooth thermal printer

I have to print invoice receipt using thermal printer. I have used Zjiang Thermal printer to print receipt. They also provide there manual & demo project. In demo project they use a libray "btsdk.jar" to implement connection & print. I have…
mukesh
  • 4,140
  • 5
  • 29
  • 40