GPS Location without service

不问归期 提交于 2019-12-10 16:54:13

问题


I am a new developer and have a simple question that I have searched all over for, but have not found a clear answer yet...

Simply put, I am developing an application that needs to be able to use GPS. The trick is however that I would like to use GPS to get a phone's location even if they have no carrier service.

With that said I have 2 questions.

  1. Is is possible to get the GPS location of a phone with no carrier service with a wifi connection?

  2. Is is possible to get the GPS location of a phone with no carrier service AND no wifi service?

Thanks in advance


回答1:


  1. Yes, it is on many handsets. The WiFi network may be mapped which will speed up the AGPS chip, or allow offloading of position calculation to the provider.

  2. Varies by the GPS chip in question. In some cases, it will simply not work (the GPS processor requires network communication). In most cases the GPS will take up to 10 minutes to fix from a cold start, as it must receive the current satellite almanac in order to compute position.




回答2:


While it it true that AGPS is dependent on some kind of data communication most Android phones have true GPS chipsets which means that they communicate with satellites in space regardless of any data connection. This will provide a more accurate position, but will be slower to acquire. Your best bet is to listen for position updates from both Network and GPS providers so that phones with a data connection will get a fast, rough fix that can be refined by the GPS and phones that don't have a data connection will simply not raise an event until the GPS gets a fix. If you want to be extremely robust then don't block waiting on the fix so the user can at least continue to use your app instead of staring at a spinning icon.



来源:https://stackoverflow.com/questions/3189188/gps-location-without-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!