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
192
votes
5 answers

Android 4.3 Bluetooth Low Energy unstable

I am currently developing an application that will use Bluetooth Low Energy (testing on the Nexus 4). After getting started with the official BLE APIs in Android 4.3, I have noticed that after I connect a device for the first time I am rarely able…
95
votes
7 answers

How can I programmatically tell if a Bluetooth device is connected?

I understand how to get a list of paired devices, but how can I tell if they are connected? It must be possible since I see them listed in my phone's Bluetooth device list and it states their connection status.
dchappelle
  • 1,580
  • 2
  • 13
  • 22
83
votes
12 answers

Android 12 New Bluetooth Permissions

Bluetooth is the main dependency of our app. So, We already try to implement new Android 12 Bluetooth permissions. Our only resource is Android developers New Bluetooth permissions in Android 12. There is just saying add…
80
votes
3 answers

Can an Android device act as an iBeacon?

Can an Android device act as an iBeacon and figure out when other Android devices come in its range? Do those other Android devices need to have Bluetooth turned on? If a customer comes into my shop and he doesn't have my app installed on his…
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113
47
votes
6 answers

Communicating between iOS and Android with Bluetooth LE

I've got a working app using CoreBluetooth to communicate between an iPad (central) and iPhone (peripheral). I have one service that has two characteristics. I have a Nexus 7 running the latest Android 4.3 with BTLE support. Android is a bit late to…
42
votes
11 answers

Bluetooth HCI snoop log not generated

I'm running Android 4.4.2 and I enabled the "Bluetooth HCI snoop log" as described here Sniffing/logging your own Android Bluetooth traffic After turning bluetooth on and off I rebooted the phone. I could not find the log file in the expected…
Jack Shultz
  • 2,031
  • 2
  • 30
  • 53
41
votes
1 answer

'App is scanning too frequently' with ScanSettings.SCAN_MODE_OPPORTUNISTIC

I noticed an issue on Samsung S8, Android 7.0 (upd. This also happens on Android 7.0: Samsung S7, Nexus 5x) which tells (after couple of tests) that app is scanning too frequently: 08-14 12:44:20.693 25329-25329/com.my.app D/BluetoothAdapter:…
40
votes
8 answers

How to pair Bluetooth device programmatically Android

I am developing an application where I want to connect a Bluetooth device main issue is I don't want user to enter required pin instead application should do that by himself...I don't have any connection related issue...Only want to insert and…
Sandip Jadhav
  • 7,377
  • 8
  • 44
  • 76
39
votes
2 answers

What do I use now that BluetoothAdapter.getDefaultAdapter() is deprecated?

How do I fix the deprecation warning in this code? Alternatively, are there any other options for doing this? val mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter() if (mBluetoothAdapter.isEnabled) {}
user15460872
39
votes
3 answers

Android: BluetoothSocket receives its own output

I have an app that connects to a RaspberryPi via Bluetooth and loops the same data to it while it receives some data back. I had some issues with the connection so this workaround is needed to connect my android phone to the RaspberryPi:…
DeMo
  • 683
  • 5
  • 14
33
votes
4 answers

Android 6.0 Marshmallow BLE : Connection Parameters

The Bluetooth Low Energy connection parameters management seems to have changed in Android 6. I have a BLE Peripheral device who needs to use some specific connection parameters (notably, the connection interval), and I want to use the minimum…
33
votes
2 answers

Android BLE, read and write characteristics

I am currently developing Android BLE, and encounters a lot of problems with the Android BLE stacks.. My development tool is Samsung Galaxy J with Android 4.3. I want to know how can I read a characteristics from the BLE and the write the…
Tim
  • 3,755
  • 3
  • 36
  • 57
32
votes
6 answers

Private vs public addresses in Bluetooth low energy on Android

A Bluetooth low energy device is uniquely identified by it's address (in the Android API they call this the MAC address and denote it as colon separated hex values e.g. 11:aa:22:bb:33:cc). But to uniquely identify a BLE address you need to know if…
Vegar Westerlund
  • 1,604
  • 3
  • 16
  • 24
30
votes
7 answers

Connect multiple devices to one device via Bluetooth

I would like to create a game, where you must connect multiple devices (4+) to a main device (ex. a tablet) via Bluetooth. There would be two apps, a main one to which all data would be send from the phones, and to the phones. Is that even possible?
domen
  • 1,239
  • 3
  • 15
  • 26
29
votes
4 answers

Bluetooth LE Scan fails in the background - permissions

The following code works great on my Nexus 9 running Android 5.1.1 (Build LMY48M), but won't work on a Nexus 9 running Android 6.0 (Build MPA44l) List filters = new ArrayList(); ScanSettings settings = (new…
1
2 3
99 100