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

Getting relative humidity from the phone's humidity sensor


Getting values from the phone's relative humidity sensor is a very similar process to getting values from the temperature or pressure sensors. The only difference is in specifying the sensor type. To get the values from the relative humidity sensor, we have to specify the sensor type as TYPE_RELATIVE_HUMIDITY. All the other standard practices  (initiating SensorManager, the Sensor object, and registering and unregistering the listener and the sensor callback) remain the same. Another point to note is that humidity and relative humidity are used interchangeably; they both refer to the same value.

Time for action - calculating the dew point and absolute humidity

We can use the phone's relative humidity and temperature sensor to calculate the dew point and absolute humidity. Before calculating, let's look at the definition and formula of the dew point and absolute humidity.

  • Dew Point: The dew point is the temperature at which a given volume...
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 ₹800/month. Cancel anytime}