The automatic torch light and screen brightness app requirements
As a learning assignment for this chapter, we will be developing a small application that will make use of the light and proximity sensor in the phone to turn on and turn off the flash light and adjust the screen brightness. This app will be running in the foreground Android activity and will start processing the sensor values on onResume()
and will stop on onPause()
. We will have the separate activity for each proximity sensor and light sensor, and both will work independently. The following are the high-level requirements for the automatic torch light application:
- Create an Android activity to process the proximity sensor values.
- Whenever any object comes close to the phone (the proximity sensor gives the near value), turn on the flashlight, and whenever that object goes away from the phone (the proximity sensor gives the far value), then turn off the flashlight.
- Create an Android activity to process the light sensor values...