title: Change brightness according to surrounding light in android
body: <p>I want to change brightness of screen according to light..</p>
  
  <p>I found links for getting brightness level and setting up brightness..</p>
  
  <p><a href="https://stackoverflow.com/questions/13212835/change-screen-brightness-onpause-android-app">Change screen brightness onPause (Android app)</a></p>
  
  <p><a href="https://stackoverflow.com/questions/9339430/how-to-toggle-auto-brightness-on-and-off-not-a-repeat">How to toggle auto brightness on and off? (not a repeat)</a></p>
  
  <p><a href="https://stackoverflow.com/questions/3737579/changing-screen-brightness-programmatically-in-android">changing screen brightness programmatically in android</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7646865/changing-screen-brightness-programmatically-as-with-the-power-widget">Changing screen brightness programmatically (as with the power widget)</a></p>
  
  <p>But I want to change brightness <b>as per surrounding light</b>..
  In short, I want to do same as auto brightness works..</p>
  
  <p>How Can I detect surrounding light?? OR Can I trigger auto brightness functionality??</p>
  
  <p>brightness is having value range between 0 to 255.
  I want to set brightness level according to surrounding light level which can not be 0 to 255. How can I get ratio between this two.</p>
  
  <p>Help is needed. Thanks</p>