Sensor to detect the closeness of an Object to the Mobile
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3018716/android-turn-off-screen-when-close-to-face">android: turn off screen when close to face</a>  </p>
</blockquote>



<p>how can i detect that my face is close to the mobile , for example :-
when i have answered to incoming call , the screen of the mobile turned-off , and when i move the device away , the screen is turned on again ,,how can we code this</p>

<p>Best Regards </p>
