开发者

how to make location stable on android

I try to receive latitude & longitude on android phone. Is location on android receive directly from satellite? Wh开发者_JAVA百科y it dynamic all the time, while I standing though? So, anyone know how to make it stable ?

Thanks


The location may come from a variety of places:

  • The "last-known" location, an OS-level cached location (fast, but may be inaccurate)
  • The wifi network (Google can often deduce location from the wifi net you're on, but not always)
  • Mobile network - if the device is on a mobile phone network, that can provide location information
  • GPS receiver. If the device is outdoors this will provide the most accurate location

Your app will have specific needs, and so you need to decide which locations you want, and what you do when you get them, based on their accuracy, and the source.

With GPS, buildings, tees, the weather, etc will all have an effect on the location, so you'll never get one amazingly accurate location. Many apps just request a location and use it, but if you need accurate, stable location data, you need to collect data from relevant sources, and then use your own algorithm to decide which to use.

You need to read, understand, and use what's in this page: http://developer.android.com/guide/topics/location/obtaining-user-location.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜