Check GPS signal [duplicate]

谁都会走 提交于 2019-12-11 09:48:40

问题


Possible Duplicate:
How to detect whether GPS signal is weak or high?

Is there any possible way to know that the GPS signal is week ? Such as the user in the building then the GPS may not send data. This is the reason why I want to check the GPS signal.


回答1:


There is no specific way to do that. I usually follow a time-out approach where you can wait for about 30-45 seconds to get a fix and if you do not get a fix within that time, you can infer that the GPS fix cannot be obtained at the current location of the user.

In case the fix is available and your onLocationChanged() method is getting called, you should use the combination of getAccuracy() and getTime() to accept the fix and infer about the strength of the signal.




回答2:


The getAccuracy() method of the Location object returned by onLocationChanged provides a good indication of how good the "fix" is.

taken from

How to detect whether GPS signal is weak or high?



来源:https://stackoverflow.com/questions/8321978/check-gps-signal

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