Android - Location by LocationManager different from GoogleMaps

南笙酒味 提交于 2019-12-06 06:38:42

Most likely GoogleMaps is using new LocationClient API, which was announced on Google I/O 2013. You may want to switch to this API too.

It is said to be more accurate and use less battery.

More info on how to get location updates: http://developer.android.com/training/location/receive-location-updates.html

Your call to requestLocationUpdates is only requesting location updates from the Network Location Provider (LocationManager.NETWORK_PROVIDER). The Network Location Provider uses cell tower and WiFi signals to determine location. There is also a GPS Location Provider (LocationManager.GPS_PROVIDER) which uses GPS satellites and is far more accurate when satellites are available. Google Maps is most likely using a combination of the two location providers to determine the most accurate position.

Take a look at this guide for some more insight into the best way to utilize Android's location services for your needs: http://developer.android.com/guide/topics/location/strategies.html

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