Chapter 4. The Light and Proximity Sensors

In this chapter, we will learn about proximity and light sensors, and we will develop a small application using them. We will also learn about the concepts of wake locks and wakeup and non-wakeup sensors. We will understand the hardware sensor FIFO queue and what happens to sensors when the application processor goes into suspended mode.

You will learn the following things in this chapter:

  • Understanding the light and proximity sensors.
  • Understanding requirements for the automatic torchlight and screen brightness app.
  • How to use the proximity sensor in the phone and turn phone's flashlight off and on.
  • How to use the phone's light sensor and adjust the screen brightness.
  • What are wake locks and how should we use ...

Get Android Sensor Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.