【问题标题】:how to detect user has finished driving(stopped the car) using google play services location APIs in Android如何在 Android 中使用谷歌播放服务位置 API 检测用户已完成驾驶(停车)
【发布时间】:2017-03-02 00:58:41
【问题描述】:

我正在做一个项目,当用户停止驾驶汽车时我需要触发某些任务,我目前在这个项目中使用谷歌播放服务位置 API,我从位置对象获得纬度、经度和速度信息onLocationChanged() 方法有办法知道用户已经停止驾驶,我认为 onLocationChanged() 回调仅在有运动时调用,是否有怎么确定没有动静?

任何帮助将不胜感激,我已经浏览了论坛,那里有关于检测运动的答案,但没有关于检测用户何时停止驾驶的信息

注意:我不想使用任何其他库,因为这会增加项目的大小

【问题讨论】:

    标签: android google-play-services


    【解决方案1】:

    您应该使用线程/服务/您想要的任何内容获取用户位置,并检查速度是否为 0(或 0 有一定容差),用户已停止

    看看http://mycodingworld1.blogspot.it/2015/12/calculate-speed-from-gps-location.html

    还有

    Determining the speed of a vehicle using GPS in android

    【讨论】:

      猜你喜欢
      • 2015-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-21
      相关资源
      最近更新 更多