Proximity sensors are also known as position sensors and allow you to determine how close your smartphone is to an object (such as your face). The distance can be measured in cm. However, most proximity sensors only return Far/Near information. Therefore, the return value will be 0 or 1, where 0/LOW is Far and 1/HIGH is Near.
As usual, you can add a Proximity Sensor widget to your project canvas from the Widget Box (Figure 6.19):
Figure 6.19: Proximity Sensor widget