0

After being pointed into light sensor things I have found myself here asking if anyone has some example code for use with dimming the screen of an android phone by using the ambient light around it.

linuxrox
  • 139
  • 1
  • 12

1 Answers1

1

This blog shows you how to get light sensor readings, http://android-coding.blogspot.com/2011/10/using-android-device-build-in-light.html

and this SO answer tells you how to adjust the brightness of the screen: Android 2.2: Adjusting screen brightness

Make sure to add any required permissions to your Android manifest for reading sensors.

Community
  • 1
  • 1
Samuel
  • 16,923
  • 6
  • 62
  • 75