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
28
votes
2 answers

Android Broadcast Receiver bluetooth events catching

I'm trying to catch bluetooth state changes with Broadcast Receiver. My manifest:
Long Smith
  • 1,339
  • 3
  • 21
  • 40
28
votes
5 answers

Android 4.3: BLE: Filtering behaviour of startLeScan()

I'm working on a BluetoothLE sensor device, for which I need to form a one-to-many broadcast of data. As per the spec, peripherals may only have a single master, and due to limitations of the chip and stack I'm designing on, a master can only have…
27
votes
6 answers

BluetoothLeScanner.startScan with Android 6.0 does not discover devices

I'm trying to use the function BluatoothLeScanner.startScan instead of the deprecated one BluetoothAdapter.startLeScan. Yesterday I updated my Nexus 5 to Android 6.0 and since that moment my app does not work anymore. I firstly add the preferences…
26
votes
5 answers

How to stream audio from one Android device to another Android device Via Bluetooth?

Is it possible to stream audio over bluetooth? During my research I found that is it only possible using A2DP(Advanced Audio Distribution Profile). And does every android device support A2DP? If not, is it possible to stream audio between two…
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113
25
votes
2 answers

How to send data over a Bluetooth Low Energy (BLE) link?

I am able to discover, connect to bluetooth. Source Code--- Connect via bluetooth to Remote Device: //Get the device by its serial number bdDevice = mBluetoothAdapter.getRemoteDevice(blackBox); //for ble connection …
sjain
  • 23,126
  • 28
  • 107
  • 185
25
votes
4 answers

Estimating beacon proximity/distance based on RSSI - Bluetooth LE

I've got a simple iOS app which displays the proximity of the Bluetooth LE beacons it detects using such expressions as "immediate", "near" etc. and I need to write something similar on Android. I've followed the tutorial at Android developer and…
JakeP
  • 1,736
  • 4
  • 23
  • 31
25
votes
5 answers

How to find out if Android device supports Bluetooth Low Energy

It seems Nexus 7 first generation doesn't support Bluetooth Low Energy, at least when I follow exactly steps from tutorial http://developer.android.com/guide/topics/connectivity/bluetooth-le.html I do have app finish on following code: if…
Andriy Kopachevskyy
  • 7,276
  • 10
  • 47
  • 56
24
votes
2 answers

Bluetooth not connecting on 4.4.2

I've got a Bluetooth device that has connected on all versions of Android that I have tried prior to 4.4.2. Now, it's not connecting on the Galaxy Tab 4 or the S3. The Tab 3 connects fine with 4.1.2. The problem seems to occur in the AcceptThread…
codeMagic
  • 44,549
  • 13
  • 77
  • 93
23
votes
5 answers

Print Pdf file via Bluetooth Printer Android

In My project Need to print Pdf file Via Bluetooth Printer. I write a code to print via pdf Its for fine for a Text, But I want to Print PDF file on Bluetooth printer. My java Code to Print Text @Override public void onCreate(Bundle…
22
votes
3 answers

Android Bluetooth & WakeLock relationship

I'm working on an Android application that runs in the background and enables support for a Bluetooth accessory. I would like to be constantly listening in the background for the Bluetooth device to try and open a socket to the phone. My question is…
Christopher Souvey
  • 2,890
  • 21
  • 21
22
votes
2 answers

How to detect when a BLE device is not in range anymore?

I use a LeScanCallback (can not use the newer scan methods because I'm developing for api 18. Not that it matters, since the android 5.0+ apis don't offer this functionality either) to detect when a nearby BLE device is detected: private…
Tim
  • 41,901
  • 18
  • 127
  • 145
21
votes
4 answers

Bluetooth LE Scanning Sometimes Doesn't Find Devices

I am scanning for Bluetooth LE devices and running as a Peripheral (running Android 6.0 on a Moto G 2nd Gen) The problem I am having is that sometimes (randomly it seems but often) it will not find any of my other peripheral devices, the other times…
kdbdallas
  • 4,513
  • 10
  • 38
  • 53
21
votes
3 answers

BLE Android - onConnectionStateChange not being called

I have a problem trying to connect to a peripheral. Sometimes the callback onConnectionStateChange(...) is not called after BluetoothDevice#connectGatt(...). What I'm trying to achieve is fast and short connections triggered by user action. This…
avmatte
  • 631
  • 2
  • 9
  • 15
20
votes
4 answers

Solution for BLE scan's SCAN_FAILED_APPLICATION_REGISTRATION_FAILED?

My Android app scans BLE devices, and from a certain point it start to fails with error code 2 (ScanCallback.SCAN_FAILED_APPLICATION_REGISTRATION_FAILED). I'm using Nexus 9, 5.0.1 Lollipop. This problem continued even after I relaunched the app, and…
20
votes
3 answers

Connect to paired bluetooth device from Xamarin on Android

We need our application to be able to connect to a paired bluetooth device automatically when an application starts via A2DP or Hands Free Profile. We are working in Xamarin (monodroid), for Android platform. I've found this stackoverflow question:…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174