安卓:强制使用Wi-Fi无线网路连接位置提供者 [英] Android: Force use of Wi-Fi as Location Provider

查看:279
本文介绍了安卓:强制使用Wi-Fi无线网路连接位置提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,我有三个位置提供可供选择:GPS,网络和被动

As I understand it, I have three location providers to choose from: GPS, Network and Passive.

我想通过检测Wi-Fi网络,我连接,我相信这两种细胞三角和Wi-Fi定位确定的网络服务提供者所覆盖,得到我的位置。

I would like to obtain my location by detecting the Wi-Fi network I'm connected to, I believe both Cell Triangulation and Wi-Fi location determination is covered under the Network provider.

然而,尽管被连接到Wi-Fi接入点,我的计划似乎总是用电池的三角,而不是Wi-Fi来确定我的位置(摆出根据返回的坐标的巨大误差)。

However, despite being connected to a Wi-Fi access point, my program always seems to use cell triangulation rather than Wi-Fi to determine my location (assumed based on the huge inaccuracy of the returned coordinates).

它看起来并不像有什么办法可以强制使用唯一的无线网络?如何Android的决定何时使用Wi-Fi满格三角?

It doesn't look like there's any way to force the use of Wi-Fi only? How does Android decide when to use Wi-Fi over cell triangulation?

推荐答案

我觉得它使用的wifi时从WiFi chipser扫描的无线网络信息相匹配的数据远程谷歌数据库(我不知道这个数据库的覆盖面,但它应该包括具有街景所有城市)。否则它使用远远不够准确细胞三角。

I think it uses wifi when the wifi information scanned from the wifi chipser matches data the remote Google database (I don't know the coverage of this database, but it should include all cities that have StreetView). Else it uses the far less accurate cell triangulation.

要检查哪一种时,你​​可以尝试 LocationProvider.requireCell()(没有测试它...)

To check which kind is used, you might try LocationProvider.requireCell() (haven't tested it...)

这篇关于安卓:强制使用Wi-Fi无线网路连接位置提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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