网络位置提供商需要互联网来确定位置吗? [英] Do network location provider need internet to determine location?

查看:83
本文介绍了网络位置提供商需要互联网来确定位置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用网络提供商进行位置提取时,Android设备是否需要互联网?我看到很少有文章说它可以在没有互联网的情况下工作,也很少说需要互联网.

Do Android devices need internet when using network provider for location fetching? I see few articles saying it works without internet and few saying it needs internet.

我正在研究Android内部如何进行位置提取(而不是代码).

I am looking more into how Android internally does location fetching (rather than the code).

说我们需要互联网的文章:设备捕获手机ID和wifi热点,并将其发送到Google服务器.和谷歌服务器返回的位置信息.这些文章说我们需要互联网来获得位置.

Articles saying we need internet: Device captures cell id and wifi hotspots and sends it to google server. And google server returns the location information. These articles are saying we need internet to get location.

很少有文章说位置是使用蜂窝三角测量来确定的,不需要互联网.

Few articles are saying location is determined using cellular triangulation and no internet is needed.

我试图做测试以确认同样的情况.但是测试结果令人困惑,无法从中得出任何结论.

I have tried to do test to confirm the same. But test results are confusing and could not deduce anything from the same.

设备配置:我已关闭互联网,wifi扫描和GPS.这意味着设备仅具有蜂窝信号.应用程序每分钟都会捕获位置.

Device configuration: I have turned off internet, wifi scan and GPS. This means device had only cellular signal. Application captures location every minute.

测试结果1:

  • 我无法使用上述设备配置获取位置.我进行了15分钟以上的测试.
  • 然后,我打开了3G数据,然后找到了位置.
  • 发布此信息后,我再次关闭了3G,但仍然能够以不同的精度获取位置.

测试用例2 :(在测试用例1之后继续)

  • 发布测试用例1后,我一直在办公室位置获得该位置.
  • 然后我回家了,当我检查地下室(-1楼)的位置时,第一次读取的位置精度约为900m,第二次和以后的读取位置则没有位置.这持续了20分钟.
  • 20分钟后,我开始接收位置信息.

网络位置的工作原理.我正在研究更多有关Android内部如何进行位置获取而不是代码的方法.

How exactly do network location works. I am looking more at how Android internally does location fetching rather than the code.

这是我的问题:

  1. 它是否通过Cellid和wifi热点并获得位置(使用互联网)?
  2. 它会做细胞三角剖分吗?
  3. 是否缓存数据并使用加速度计和指南针来确定位置,而无需上网吗?

(尽管stackoverflow中存在类似的问题.它们更多地是代码而不是Android内部工作的问题.因此请发布此问题)

推荐答案

在为Android开发位置感知应用程序时,您可以利用GPS和Android的网络位置提供商获取用户位置.尽管GPS最精确,但只能在户外使用,它会很快消耗电池电量,并且无法如用户所愿地快速返回位置.

When developing a location-aware application for Android, you can utilize GPS and Android's Network Location Provider to acquire the user location. Although GPS is most accurate, it only works outdoors, it quickly consumes battery power, and doesn't return the location as quickly as users want.

Android的网络位置提供商使用手机信号塔和Wi-Fi信号确定用户的位置,以在室内和室外均可使用的方式提供位置信息,响应速度更快,并消耗更少的电池电量.要在应用程序中获取用户位置,可以同时使用GPS和网络位置提供程序,也可以仅使用其中之一.

Android's Network Location Provider determines user location using cell tower and Wi-Fi signals, providing location information in a way that works indoors and outdoors, responds faster, and uses less battery power. To obtain the user location in your application, you can use both GPS and the Network Location Provider, or just one.

If you are using both NETWORK_PROVIDER and GPS_PROVIDER, then you need to request only the permission ACCESS_FINE_LOCATION 

ACCESS_COARSE_LOCATION includes permission only for NETWORK_PROVIDER

根据您使用的权限,可能会得出不同的结果

depending on the permission which you are using may give the different results

检查这些网站和<一种href ="http://developer.android.com/guide/topics/location/strategies.html" rel ="nofollow noreferrer"> Android用于定位的策略

取决于Anil vk的评论

网络–>(AGPS,CellID,WiFi MACID):此提供商根据蜂窝塔和WiFi接入点的可用性来确定位置.通过网络查找来检索结果.需要权限 android.permission.ACCESS_COARSE_LOCATION或android.permission.ACCESS_FINE_LOCATION.

network –> (AGPS, CellID, WiFi MACID) : This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. Requires either of the permissions android.permission.ACCESS_COARSE_LOCATION or android.permission.ACCESS_FINE_LOCATION.

答案是,它取决于来自信号塔的信号强度以获得准确的结果,您可以看到此

the answer is yes it depends on the signal strength from cell tower to get accurate results you can see this website for accuracy and battery draining issues by using different ways.

这篇关于网络位置提供商需要互联网来确定位置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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