Android app which interacts with BLE devices not working on Chromebook

老子叫甜甜 提交于 2019-12-05 02:48:31

问题


I have an Android app which interacts with custom BLE devices. This app works as expected on devices which have android version 4.4 to 6.0. Now I want to make this available on Chromebooks through the Google Playstore on Chromebooks(App Runtime for Chrome).

I installed this app on my Google Asus Flip Chromebook(Chrome OS version 55, ARC version 3617689) by sideloading the APK onto it. But it is not working as expected.

These are the steps I took:

  1. Call a startLeScan() which gives the BluetoothDevice as a scanResult.
  2. Call the connectGatt() method, and the device is connected and in the onConnectionStateChange() callback, get a handle to the BluetoothGatt.
  3. Call the discoverServices.
  4. After that, the onServicesDiscovered() callback is hit as expected with status = GATT_SUCCESS. However gatt.getServices returns an empty list when running on Chromebook. When running on Android device (API 19 to API23) I get BluetoothGattService handles to all the services supported by my BLE device.

Which leads me to suspect the BLE implementation on ARC on Chromebook. Has anybody else faced this issue? Is anyone using Android BLE APIs on Chrome OS?


回答1:


I've having the same trouble, and it appears to be a deficiency with the BLE implementation on Chromebooks. Although there isn't a fix or workaround, the issue is being tracked at https://bugs.chromium.org/p/chromium/issues/detail?id=722987



来源:https://stackoverflow.com/questions/41972045/android-app-which-interacts-with-ble-devices-not-working-on-chromebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!