禁用移动用户同时正在推动以一定速度? [英] Disable mobile while user is driving at certain speed?

查看:109
本文介绍了禁用移动用户同时正在推动以一定速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将功能添加到我们的移动应用程序,这是以用户的同时正在推动以一定速度禁用移动设备。这是一个好主意,听 LocationManager.GPS_PROVIDER &安培;使用getSpeed​​()?有人能对此有何评论?

I need to add a feature to our mobile application which is "to disable the mobile device while user is driving at certain speed". Is this a good idea to listen to the LocationManager.GPS_PROVIDER & use the getSpeed()? Can someone comment on it?

推荐答案

您必须记录previous位置,然后在一个特定的时间间隔与新的位置查询(preSET到5-10sec )和得到的时间框架移动来获得速度的距离。
它的一个很好的概念,但它会耗尽你的设备电池。

You will have to record the previous location and then check with the new location in a particular interval of time(preset to 5-10sec) and the get the distance moved in a time frame to get speed. Its a good concept but it will drain your device battery.

这篇关于禁用移动用户同时正在推动以一定速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆