Android:我可以通过哪些方式以编程方式获取当前位置
我可以通过多少种方法在 Android 中以编程方式获取当前地理位置(纬度、朗度),哪种方法是最好、准确和更快的方法?
期待您的建议
谢谢
How many ways I can get the current geo location (lat,lang) programatically in Android, Which is the best, accurate and faster way??
Look forward to your suggestions
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该阅读获取用户位置 在 SDK 的文档中。
You should read Obtaining User Location in the SDK's documentation.
可以通过 IP 地址查找位置:
http://www.google.com.sg/search?aq=1&oq=identifying+location&sourceid=chrome&ie=UTF- 8&q=identifying+location+of+ip+addresses
另一种方法是通过 GSM 或控制平面定位,但其他方法可以在此处找到:
http://en.wikipedia.org/wiki/Location-based_service#Others
It is possible to find out location via IP address:
http://www.google.com.sg/search?aq=1&oq=identifying+location&sourceid=chrome&ie=UTF-8&q=identifying+location+of+ip+addresses
Another method is by GSM, or control-plane locating, yet other methods can be found here:
http://en.wikipedia.org/wiki/Location-based_service#Others
在为 Android 开发位置感知应用程序时,您可以利用 GPS 和 Android 的网络位置提供程序来获取用户位置。尽管 GPS 最准确,但它只能在室外工作,会很快消耗电池电量,并且无法按照用户希望的速度返回位置。 Android 的网络位置提供程序使用手机信号塔和 Wi-Fi 信号确定用户位置,以在室内和室外工作、响应速度更快且使用更少电池电量的方式提供位置信息。要在应用程序中获取用户位置,您可以同时使用 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'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`