BLE 扫描是否适用于没有 GPS 芯片的平板电脑?

Is BLE scan will work in tablets which does not have GPS chip?

我在 BLE 应用程序中工作。我对执行 BLE 扫描的 GPS 权限有一些疑问。

  1. BLE 扫描是否适用于没有 GPS 芯片的平板电脑?
  2. startLescan() 可以在没有 GPS 许可的情况下运行吗?

是的。

您只需要打开平板电脑的蓝牙即可。 BLE完全依赖蓝牙,你只需要看看平板蓝牙是否支持BLE即可。

BLE 与 GPS 完全没有关系。详细解释如下:https://developer.android.com/guide/topics/connectivity/bluetooth-le

您可能需要声明以下权限:

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>

<!-- If your app targets Android 9 or lower, you can declare
     ACCESS_COARSE_LOCATION instead. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

注意:虽然 GPS 并未实际使用,但您必须声明 ACCESS_COARSE_LOCATIONACCESS_FINE_LOCATION 才能正常工作,因为信标通常用于提供位置信息。