Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Sensor Programming By Example

You're reading from   Android Sensor Programming By Example Take your Android applications to the next level of interactivity by exploring the wide variety of Android sensors

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher Packt
ISBN-13 9781785285509
Length 194 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Varun Nagpal Varun Nagpal
Author Profile Icon Varun Nagpal
Varun Nagpal
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Sensor Fundamentals FREE CHAPTER 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

What this book covers

Chapter 1, Sensor Fundamentals, provides you a thorough understanding of the fundamentals and framework of Android sensors. It walks you through the different types of sensors and the sensor coordinate system in detail.

Chapter 2, Playing with Sensors, guides you through various classes, callbacks, and APIs of the Android Sensor framework. It walks you through a sample application, which provides a list of available sensors and their values and individual capabilities, such as the range of values, power consumption, minimum time interval, and so on.

Chapter 3, The Environmental Sensors – The Weather Utility App, explains the usage of various environment sensors. We develop a weather utility app to compute altitude, absolute humidity, and dew point using temperature, pressure, and relative humidity sensors.

Chapter 4, The Light and Proximity Sensors, teaches you how to use proximity and light sensors. It explains the difference between wakeup and non-wakeup  sensors and explains the concept of the hardware FIFO sensor queue. As a learning exercise, we develop a small application that turns on/off a flashlight using a proximity sensor, and it also adjusts screen brightness using a light sensor.

Chapter 5, The Motion, Position, and Fingerprint Sensors, explains the working principle of motion sensors (accelerometer, gyroscope, linear acceleration, gravity, and significant motion), position sensors (magnetometer and orientation), and the fingerprint sensor. We learn the implementation of these sensors with the help of three examples. The first example explains how to use the accelerometer sensor to detect phone shake. The second example teaches how to use the orientation, magnetometer, and accelerometer sensors to build a compass, and in the third example, we learn how to use the fingerprint sensor to authenticate a user.

Chapter 6, The Step Counter and Detector Sensors – The Pedometer App, explains how to use the step detector and step counter sensors. Through a real-world pedometer application, we learn how to analyze and process the accelerometer and step detector sensor data to develop an algorithm for detecting the type of step (walking, jogging, sprinting). We also look at how to drive the pedometer data matrix (total steps, distance, duration, average speed, average step frequency, calories burned, and type of step) from the sensor data.

Chapter 7, The Google Fit Platform and APIs – The Fitness Tracker App, introduces you to the new Google Fit platform. It walks you through the different APIs provided by the Google Fit platform and explains how to request automated collection and storage of sensor data in a battery-efficient manner without the app being alive in the background all the time. As a learning exercise, we develop a fitness tracker application that collects and processes the fitness sensor data, including the sensor data obtained from remotely connected Android Wear devices.

Bonus Chapter, Sensor Fusion and Sensor – Based APIs (the Driving Events Detection App), guides you through the working principle of sensor-based Android APIs (activity recognition, geo-fence, and fused location) and teaches you various aspects of sensor fusion. Through a real-world application, you will learn how to use multiple sensors along with input from sensor-based APIs to detect risky driving behavior. Through the same application, you will also learn how to develop the infrastructure (service, threads, and database) required to process high volumes of sensor data in the background for a longer duration of time. This chapter is available online at the link https://www.packtpub.com/sites/default/files/downloads/SensorFusionandSensorBasedAPIs_TheDrivingEventDetectionApp_OnlineChapter.pdf

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 $19.99/month. Cancel anytime
Banner background image