Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Android Sensor Programming By Example

You're reading from  Android Sensor Programming By Example

Product type Book
Published in Apr 2016
Publisher Packt
ISBN-13 9781785285509
Pages 194 pages
Edition 1st Edition
Languages
Author (1):
Varun Nagpal Varun Nagpal
Profile icon Varun Nagpal

Table of Contents (13) Chapters

Android Sensor Programming By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Sensor Fundamentals 2. Playing with Sensors 3. The Environmental Sensors – The Weather Utility App 4. The Light and Proximity Sensors 5. The Motion, Position, and Fingerprint Sensors 6. The Step Counter and Detector Sensors – The Pedometer App 7. The Google Fit Platform and APIs – The Fitness Tracker App

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:

  1. Create an Android activity to process the proximity sensor values.
  2. 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.
  3. Create an Android activity to process the light sensor values...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}