David Matos
David Matos

Reputation: 560

Is it possible to change the maximum range on the Android proximity sensor?

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?

Upvotes: 0

Views: 1955

Answers (1)

xiaomi
xiaomi

Reputation: 6703

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.

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.

Upvotes: 2

Related Questions