Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

Introducing device sensors


Humans have senses (touch, hear, smell, and so on); a phone has digital "senses": touch, geolocation, orientation, and motion. A sensor is a device component that measures a physical quantity and converts it into a signal that is understandable to software. Modern mobile phones come with a variety of sensors that can support users when completing their daily tasks. By tapping into a device sensor, you can enhance the end user experience and develop sophisticated apps.

Sensors can be hardware-based or software-based. Hardware-based sensors are physical components built into a handset or tablet device. They derive their data by directly measuring specific environmental properties such as acceleration, geomagnetic field strength, or angular change. Software-based sensors are not physical devices, although they mimic hardware-based sensors.

Typical device sensors are the accelerometer, gyroscope, compass, barometer, orientation sensor, and so on.

Not all devices, nor...