android-bluetooth

Bluetooth LE: undocumented error code 19

青春壹個敷衍的年華 提交于 2021-02-10 13:14:20
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

与世无争的帅哥 提交于 2021-02-10 13:11:08
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

冷暖自知 提交于 2021-02-10 13:10:04
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth LE: undocumented error code 19

白昼怎懂夜的黑 提交于 2021-02-10 13:08:08
问题 My Android app uses BLE APIs, and one of these APIs, BluetoothGattCallback.onConnectionStateChange() , receives an undocumented error code 19. I'm using Nexus 9. Did anybody ever see this error code before? Like I mentioned above, this is undocumented in the Android API reference, and I don't know what to do about it. P.S. I searched issue tickets at Android issue tracker also, and found that developers encounter undocumented, BLE-related error codes often. Hmm, this is grim. 来源: https:/

Bluetooth 5.1 Angle of Arrival backward compatibility

流过昼夜 提交于 2021-02-10 12:46:50
问题 I am currently designing a simple indoor location project to evaluate possibilities of Bluetooth 5.1 standard. The feature I would like to use is AoA (Angle of Arrival) introduced in Bluetooth 5.1. According to the standard, AoA allows to measure position of a transmitting device (tx) by approximating the angle and measuring RSSI on a locator/receiver (rx). Since AoA is a feature newly implemented in 5.1, I understand that rx needs to support 5.1 Bluetooth standard. How about the transmitting

How to detect whenever my android device gets connected/disconnected from paired bluetooth device

陌路散爱 提交于 2021-02-07 21:40:05
问题 I would like to receive an event for detecting whenever bluetooth gets paired or unpaired in my device. In the beginning i found http://developer.android.com/reference/android/bluetooth/BluetoothServerSocket.html. I followed this blog : http://android-er.blogspot.co.il/2014/12/make-bluetooth-connection-between.html which is quite usefull, but, isn't detecting when a new connection is made. Needless to say, I have no use for bluetooth implementation, which i'm well aware of : final

How to detect whenever my android device gets connected/disconnected from paired bluetooth device

不问归期 提交于 2021-02-07 21:38:26
问题 I would like to receive an event for detecting whenever bluetooth gets paired or unpaired in my device. In the beginning i found http://developer.android.com/reference/android/bluetooth/BluetoothServerSocket.html. I followed this blog : http://android-er.blogspot.co.il/2014/12/make-bluetooth-connection-between.html which is quite usefull, but, isn't detecting when a new connection is made. Needless to say, I have no use for bluetooth implementation, which i'm well aware of : final

ACCESS_COARSE_LOCATION does not work on Android 6 [duplicate]

天大地大妈咪最大 提交于 2021-02-05 05:27:51
问题 This question already has answers here : Android permission doesn't work even if I have declared it (13 answers) Closed 4 years ago . I follow the official example to write this program public class BluetoothActivity extends AppCompatActivity { private static final long SCANNING_TIMEOUT = 5000; /* 5 seconds */ private static final int ENABLE_BT_REQUEST_ID = 1; private BleWrapper mBleWrapper = null; private boolean mScanning = false; private Handler mHandler = new Handler(); private

How to detect bluetooth changes (connection state and characteristic) when app is in background without a foreground service

送分小仙女□ 提交于 2021-01-29 13:10:05
问题 I have a device that is a simple BLE device with a button, and I need to detect when the user long presses the device (via characteristic change) even when the app is in the background. This click will trigger a remote call the server. I have two questions regarding this: #1 Can I have this achieved without a foreground service? #2 If I have a foreground service running with the BLE GATT callbacks how can I detect when the device is in range again? My current solution is to have a foreground

BLE Advertise data size limit

百般思念 提交于 2021-01-29 07:42:54
问题 On My Addroid app I'm trying to add some extra data when I try to start ble advertising, and as I've read, advertise data must be <= 31 bytes. That's how I do it: var testData = "abcdefghij" var data = AdvertiseData.Builder().apply { addServiceData( ParcelUuid(MY_UUID), testData.toByteArray(Charsets.UTF_8) ) } bleAdvertiser.startAdvertising( settings.build(), data.build(), advertiseCallback ) In this way everything works well. Now if testData fields become var testData = "abcdefghijk"