gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 10:58:52 25 4
gpt4 key购买 nike

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

  • BLE 扫描是否适用于没有 GPS 芯片的平板电脑?
  • startLescan() 可以在没有 GPS 许可的情况下工作吗?
  • 最佳答案

    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使事情正常工作,因为信标通常用于提供位置信息。

    关于android - BLE 扫描是否适用于没有 GPS 芯片的平板电脑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58968429/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com