Understanding the light and proximity sensors
The light sensor is a part of the environmental sensors, and the proximity sensor is a part of the positional sensors for Android. Both light and proximity sensors can be found in almost every Android device today. The light sensor is responsible for measuring the illuminance in lux. Illuminance is the amount of light striking a surface. It is also known as incident light, where the "incident" is the beam of light actually landing on the surface.
The proximity sensor measures the proximity of any object near the screen. There are two types of proximity sensor found on Android devices.
- The first type of the proximity sensor provides the absolute distance in centimetres between the object and the phone. There are very few phones which support this type of proximity sensor.
- The second type of sensor gives only two values in form of integers, which represents the proximity of the object from the phone. When the object is near, then the value is 0, while...