Location update rate in Google Maps (Android)

梦想的初衷 提交于 2019-12-06 06:05:16

The frequency of updates is highly dependent on the hardware. Good gps chips send very frequent updates(Samsung Galaxy S3) while some struggle even to show lat-lan position. The gist here is normalize the the frequency for receiving updates on the basis of distance and time. Use various time and distance configuration and test them and use the most appropriate values. For my project I used following values: //for walking user

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5, 10, this);

//for user in a car

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2, 50, this);

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