Android location update with fusedApi, only if am moving

ぃ、小莉子 提交于 2019-12-24 04:53:15

问题


How to get location update for every 1000 meter,ie update only if am moving ,with fused api integration.


回答1:


When you are building your LocationRequest to be used by the FusedLocationApi you can use the method setSmallestDisplacement(...) as specified in the documentation like below:

locationRequest.setSmallestDisplacement(1000);

Note that the argument is in meters.



来源:https://stackoverflow.com/questions/35249408/android-location-update-with-fusedapi-only-if-am-moving

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