是否有可能改变对Android的接近传感器的最大范围是多少? [英] Is it possible to change the maximum range on the Android proximity sensor?

查看:390
本文介绍了是否有可能改变对Android的接近传感器的最大范围是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以用接近传感器检测到的东西比进一步()由sensor.getMaximumRange返回的最大范围?像50厘米而不是8cm的,现在我得到?

Can I use the proximity sensor to detect something further than the maximum range returned by sensor.getMaximumRange()? Something like 50cm instead of the 8cm I'm getting now?

推荐答案

我不这么认为。通常情况下,接近传感器回馈 0或最大范围,因为这是通常用来关闭屏幕,当你打电话,你的头是手机附近。

I don't think so. Usually the proximity sensor give back 0 or max range because this is usually used to turn the screen off when you call and your head is near the phone.

注:有些接近传感器只支持二进制或近或远
  测量。在这种情况下,该传感器应报告其最大范围
  在遥远的状态值,并在不久的状态下一个更低的值。

Note: Some proximity sensors only support a binary near or far measurement. In this case, the sensor should report its maximum range value in the far state and a lesser value in the near state.

这真的取决于手机的硬件之后,但我怀疑,你可以outranged的maxRange值。您仍然可拍摄约传感器堆叠但本地在 AOSP看看片段是接近到什么 android.hardware

After it really depends of the hardware of the phone but I doubt that you can outranged the maxRange value. You can still take a look on aosp about the sensor stack but the native fragment is close to what android.hardware is.

这篇关于是否有可能改变对Android的接近传感器的最大范围是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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