0

I want to increase sensitivity level of Android Proximity Sensor so that it can trigger from long distance. current it work when object is is too close about 1.5 inch i want to increase 3 to 4 inches. it is possible?

private SensorManager mSensorManager;
private Sensor mProximity;
private static final int SENSOR_SENSITIVITY = 8;
public int count=0;

@Override
public void onSensorChanged(SensorEvent event) {
    TextView tv = (TextView)findViewById(R.id.textView);
    if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) {
        if (event.values[0] < SENSOR_SENSITIVITY) {
            count++;
            tv.setText("Count:"+count);
        }
    }
}


here you can see!
**private static final int SENSOR_SENSITIVITY = 8;**
i am using sensor sensitivity =8 but when is increase to 20 nothing change

0 Answers0