如果GPS关闭,WiFi getScanResults将返回一个空列表. (Android 6.0.1) [英] WiFi getScanResults returns an empty list if GPS is off. (Android 6.0.1)

查看:250
本文介绍了如果GPS关闭,WiFi getScanResults将返回一个空列表. (Android 6.0.1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在此gif中解释问题

i tried to explain the problem in this gif

基本上,该测试应用会收到"RSSI_CHANGED"意图,并在屏幕上显示扫描结果.

basically, this test app receives an "RSSI_CHANGED" intent and displays the scan results on the screen.

除非启用了GPS,否则扫描结果始终为空.

scan results are always empty unless GPS is enabled.

我想我的问题是为什么?

要通过蓝牙和Wi-Fi扫描访问附近的外部设备的硬件标识符,您的应用现在必须具有ACCESS_FINE_LOCATION或ACCESS_COARSE_LOCATION权限

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

我已授予"ACCESS_COARSE_LOCATION"

I have "ACCESS_COARSE_LOCATION" granted

推荐答案

Google,Apple,Microsoft等人建立,维护和销售Wi-Fi路由器及其位置的数据库.通过要求您在扫描附近的WiFi网络时启用定位功能,它们可以获取并更新这些数据.

Google, Apple, Microsoft, et al, build, maintain, and sell databases of Wi-Fi routers and their locations. By requiring you to enable location functionality when scanning nearby WiFi networks, they acquire and update these data.

这篇关于如果GPS关闭,WiFi getScanResults将返回一个空列表. (Android 6.0.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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