与无法在Chromebook上运行的BLE设备交互的Android应用 [英] Android app which interacts with BLE devices not working on Chromebook

查看:97
本文介绍了与无法在Chromebook上运行的BLE设备交互的Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与自定义BLE设备交互的Android应用.这个应用程式在搭载Android 4.4至6.0版本的装置上可以正常运作.现在,我想通过Chromebooks(适用于Chrome的应用运行时)上的Google Play商店在Chromebooks上提供此功能.

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).

我通过将APK侧面加载到Google Asus Flip Chromebook(Chrome操作系统版本55,ARC版本3617689)上来安装了此应用.但是它没有按预期工作.

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.

这些是我采取的步骤:

  1. 调用startLeScan(),将BluetoothDevice作为scanResult.
  2. 调用connectGatt()方法,设备已连接,并在onConnectionStateChange()回调中获取BluetoothGatt的句柄.
  3. 致电discoverServices.
  4. 在那之后,按预期的状态= GATT_SUCCESS命中了onServicesDiscovered()回调. 但是,当在Chromebook上运行gatt.getServices时,它会返回一个空列表.在Android设备(API 19至API23)上运行时,我获得了BLE设备支持的所有服务的BluetoothGattService句柄.
  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.

这使我怀疑Chromebook在ARC上的BLE实现. 还有其他人面对这个问题吗?是否有人在Chrome操作系统上使用Android BLE API?

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?

推荐答案

我也遇到了同样的麻烦,而且Chromebook上的BLE实施似乎存在缺陷.尽管没有修复程序或解决方法,但已在跟踪了该问题. https://bugs.chromium.org/p/chromium/issues/detail?id=722987

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

这篇关于与无法在Chromebook上运行的BLE设备交互的Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆