如何知道定位模式是WIFI或2G / 3G手机信号塔的机器人?机器人、手机信号、模式、WIFI

2023-09-06 00:57:27 作者:天青色等烟雨

我们知道有两种定位方式在安卓GPS和网络。如果我们使用网络,那么机器人可以使用WIFI或2G / 3G蜂窝基站来定位。如果没有GPS,我们可以简单地使用LocationManager.NETWORK_PROVIDER来获取定位数据。但是我们怎么能知道模式为WIFI或2G / 3G手机信号塔到底是什么? Android不支持WIFI和手机信号塔提供了独立的供应商。

We know there are two positioning mode in Android: GPS and network. If we use network, then Android can use WIFI or 2G/3G cell tower to position. Without GPS, we can simply use LocationManager.NETWORK_PROVIDER to get the location data. But how can we know the mode is WIFI or 2G/3G cell tower exactly? Android doesn't provide separate providers for WIFI and cell tower.

我已经想到了一个方法。但我不知道它是否是正确的。请审查并发表意见:

I have thought a method. But I am not sure whether it is correct. Please review and give comments:

检查我是否能得到一个WIFI热点列表。如果没有在列表中,手机信号塔必须使用。 如果有一些WiFi热点,而且精度高(小于= 100米),那么WIFI很可能使用。如果精度低,仍是手机信号塔用?

在我的理解,WIFI定位的精确度是比较高的。但是,什么是对于它的精确度的正常范围?另一个问题是,是否使用Android的WIFI和手机信号塔在同一时间?如果确实如此,那么在我的应用程序,我可以把它用WIFI,没有手机信号塔。

In my understanding, the accuracy of WIFI positioning is relatively high. But what's the normal range of the accuracy for it? Another question, does Android use WIFI and cell tower at the same time? If it does, then in my application, I can think it use WIFI, not cell tower.

谢谢!

推荐答案

这是正确的,Android不明确地给出一个方法来确定网络位置是如何计算出来的。网络提供商的原理是收集设备上的所有相关数据,然后把它们发送到谷歌的服务器,你的位置被计算并送还给你。我不知道,但网络位置也可能使用加速计/陀螺仪/指南针数据,以提高定位的精度,尤其是当你不断地计算出自己的位置。 因此,我相信它可以同时使用手机信号塔和无线信息。

This is correct, Android does not explicitely give a way to determine how the network location is computed. The principle of the network provider is to collect all the relevant data on the device, and then send it all to the Google servers, where your location is computed and sent back to you. I am not sure, but the network location might also use the accelerometer/gyro/compass data to improve the accuracy of the location, especially when you compute your location continuously. So I believe it can use simultaneously cell tower and Wifi info.

您精确度的方法应该在大多数情况下,但不是100%可靠。

Your accuracy method should work in most cases, but is not 100% reliable.

另一种可能性是打开WiFi关闭,计算第一定位,然后再次打开它,并给它一个尝试。通过比较这两个位置,其精确度估算,你可能猜到的Wi​​Fi上的定位引擎的影响在当前位置。

Another possibility is to turn the wifi off, compute a first location fix, then turn it on again and give it another try. by comparing the two locations and their accuracy estimates, you can probably guess the influence of wifi on the location engine at your current location.

出于好奇,你为什么需要这个?

Out of curiosity, why do you need this for?