Start location strategy

非 Y 不嫁゛ 提交于 2019-11-30 18:34:47

At the Google IO 2013 they showed in the session Beyond the Blue Dot: New Features in Android Location a new approach, see the video here.

The engineers at Google tried a lot of different strategies, the result is the "Fused location provider". Its quality is shown at 12:17 in the video.

Ketan Parmar has published a blog post how the fused location provider can be used in an example application.

Start up the location manager with the passive provider first

locationManager.requestLocationUpdates(LocationManager.PASSIVE_PROVIDER, AlarmManager.INTERVAL_FIFTEEN_MINUTES, 75, this);

then once you get a response from that you can switch to your gps hardware.

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