简体   繁体   中英

Light sensor to dim screen?

指向光传感器之后,我发现自己在这里问是否有人可以使用周围的环境光来调暗Android手机屏幕的示例代码。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM