Sunday 7 December 2014

Light Sensors in Android .

The Light Sensor is one of the simplest sensors on a device. This sensor gives a reading of the

light level detected by the light sensor of the device. As the light level changes,the sensors

readings change. The units of the data are in SI lux units.

For the values array in the SensorEvent object, a light sensor uses just the first element values[0].

This value is a float and ranges technically from 0 to the maximum value for the particular sensor.

We say technically because the sensor may only send very small values when there's no light,and

never actually send a value of 0.

For Example:

SensorManager has a constant called LIGHT_SUNLIGHT_MAX, which is float value of 120,000.

No comments:

Post a Comment