为什么 Android Marshmallow 需要 GPS 才能找到 iBeacons。?
Why Android Marshmallow requires GPS to find iBeacons.?
我开发了一个与 iBeacons 一起使用的应用程序,这周我更新它以在 Marshmallow 上工作。在更新之前它不需要 GPS,但在更新之后它说要在后台找到信标它需要 gps。我没有找到任何参考资料。有人知道为什么 Android Marshmallow 需要 GPS 才能找到 iBeacons 吗?
我使用 altBeacon 库来定位信标。
编辑:
我会澄清这个问题。 GPS 是否参与寻找信标。除了权限。
来自 http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html
To access the hardware identifiers of nearby external devices via
Bluetooth and Wi-Fi scans, your app must now have the
ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions:
它不需要 GPS,但由于信标是一种也可以确定您的位置的技术,因此需要位置许可。
这可能是权限问题。 iBeacon 使用 BT Low Energy,在 Android 6 中,您需要位置权限才能启动扫描:
To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions
不,在 Android6 中不需要打开 GPS,甚至不需要带有 GPS 无线电的设备来检测信标。 GPS 无线电(如果存在)在扫描蓝牙信标时不会激活。
混淆是因为 Android 6 新要求应用程序获得 ACCESS_FINE_LOCATION
或 ACCESS_COARSE_LOCATION
权限才能执行蓝牙扫描。这一变化只是为了告知用户蓝牙扫描可用于推断他们的位置(如使用信标)。但需要获得此许可并不意味着对 GPS 无线电有任何技术依赖性。考虑到 Android 也可以使用 WiFi 接入点和基站来推断位置。
在某些设备上,尤其是 Nexus 5,有报告称禁用定位服务(设置 -> 位置 -> 关闭)会禁用扫描蓝牙设备的能力。目前尚不清楚这是 Nexus 5 构建映像中的错误,还是 Android 的新安全限制,将来会在其他型号上采用。 See here for more info. 无论如何,打开 GPS 无线电并不是启用定位服务的必要条件。
全面披露:我是 Android Beacon Library 开源项目的首席开发人员。
我开发了一个与 iBeacons 一起使用的应用程序,这周我更新它以在 Marshmallow 上工作。在更新之前它不需要 GPS,但在更新之后它说要在后台找到信标它需要 gps。我没有找到任何参考资料。有人知道为什么 Android Marshmallow 需要 GPS 才能找到 iBeacons 吗? 我使用 altBeacon 库来定位信标。
编辑: 我会澄清这个问题。 GPS 是否参与寻找信标。除了权限。
来自 http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html
To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions:
它不需要 GPS,但由于信标是一种也可以确定您的位置的技术,因此需要位置许可。
这可能是权限问题。 iBeacon 使用 BT Low Energy,在 Android 6 中,您需要位置权限才能启动扫描:
To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions
不,在 Android6 中不需要打开 GPS,甚至不需要带有 GPS 无线电的设备来检测信标。 GPS 无线电(如果存在)在扫描蓝牙信标时不会激活。
混淆是因为 Android 6 新要求应用程序获得 ACCESS_FINE_LOCATION
或 ACCESS_COARSE_LOCATION
权限才能执行蓝牙扫描。这一变化只是为了告知用户蓝牙扫描可用于推断他们的位置(如使用信标)。但需要获得此许可并不意味着对 GPS 无线电有任何技术依赖性。考虑到 Android 也可以使用 WiFi 接入点和基站来推断位置。
在某些设备上,尤其是 Nexus 5,有报告称禁用定位服务(设置 -> 位置 -> 关闭)会禁用扫描蓝牙设备的能力。目前尚不清楚这是 Nexus 5 构建映像中的错误,还是 Android 的新安全限制,将来会在其他型号上采用。 See here for more info. 无论如何,打开 GPS 无线电并不是启用定位服务的必要条件。
全面披露:我是 Android Beacon Library 开源项目的首席开发人员。