Other Sensors

The proliferation of small and low-power Micro-Electro-Mechanical Systems (MEMS) is becoming more evident. Smart-phones are becoming an aggregator of sensors, and the push for sensor accuracy by smart-phone manufacturers is driving the need for better performing devices.

As discussed in Chapter 1,"Overview of Android," each Android phone has a selection of different sensors.The standard two are a three-axis accelerometer to determine device tilt and a three-axis magnetometer to determine compass direction. Other devices that might be integrated are temperature sensor, proximity sensor, light sensor, and gyroscope. Currently supported sensors in the Android Software Development Kit (SDK) are listed in Table 7.1.

Table 7.1 The Sensors Accessible from the Android SDK

Sensor Type

Description

TYPE_ACCELEROMETER

Measures acceleration in meters/sec2

TYPE_ALL

Describes sensor types and is a constant

TYPE_GYROSCOPE

Measures orientation based on angular momentum

TYPE_LIGHT

Measures ambient light in lux

TYPE_MAGNETIC_FIELD

Measures magnetic field in micro-Tesla

TYPE_PRESSURE

Measures air pressure

TYPE_PROXIMITY

Measures distance of blocking object in centimeters

TYPE_TEMPERATURE

Measures temperature in degrees Celsius

The getSensorList() method lists all the available sensors in a particular device.A SensorManager manages all sensors. It provides various sensor event listeners with two callback functions—onSensorChanged() and onAccuracyChanged()—that are used to listen for sensor value and accuracy changes.

The getSensorList() method lists all the available sensors in a particular device.A SensorManager manages all sensors. It provides various sensor event listeners with two callback functions—onSensorChanged() and onAccuracyChanged()—that are used to listen for sensor value and accuracy changes.

Character Building Thought Power

Character Building Thought Power

Character-Building Thought Power by Ralph Waldo Trine. Ralph draws a distinct line between bad and good habits. In this book, every effort is made by the writer to explain what comprises good habits and why every one needs it early in life. It draws the conclusion that habits nurtured in early life concretize into impulses in future for the good or bad of the subject.

Get My Free Ebook


Post a comment