blob: 75a1716c1931fe9375d15702f0324211ae8443ea [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001page.title=Sensors
2@jd:body
3
4<div id="qv-wrapper">
Bill Gruberf8c029e2011-11-01 09:31:57 -07005 <div id="qv">
6 <h2>Topics</h2>
7 <ol>
8 <li><a href="{@docRoot}guide/topics/sensors/sensors_overview.html">Sensors Overview</a></li>
9 <li><a href="{@docRoot}guide/topics/sensors/sensors_motion.html">Motion Sensors</a></li>
10 <li><a href="{@docRoot}guide/topics/sensors/sensors_position.html">Position
11 Sensors</a></li>
12 <li><a href="{@docRoot}guide/topics/sensors/sensors_environment.html">Environment
13 Sensors</a></li>
14 </ol>
15 <h2>Key classes and interfaces</h2>
16 <ol>
17 <li>{@link android.hardware.Sensor}</li>
18 <li>{@link android.hardware.SensorEvent}</li>
19 <li>{@link android.hardware.SensorManager}</li>
20 <li>{@link android.hardware.SensorEventListener}</li>
21 </ol>
22 <h2>Related samples</h2>
23 <ol>
24 <li><a href="{@docRoot}resources/samples/AccelerometerPlay/index.html">Accelerometer
25 Play</a></li>
26 <li><a
27href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html">
28API Demos (OS - RotationVectorDemo)</a></li>
29 <li><a
30href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/Sensors.html">API Demos
31(OS - Sensors)</a></li>
32 </ol>
33 </div>
34</div>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035
Bill Gruberf8c029e2011-11-01 09:31:57 -070036<p>Most Android-powered devices have built-in sensors that measure motion, orientation,
37and various environmental conditions. These sensors are capable of providing raw data with high
38precision and accuracy, and are useful if you want to monitor three-dimensional device movement or
39positioning, or you want to monitor changes in the ambient environment near a device. For example, a
40game might track readings from a device's gravity sensor to infer complex user gestures
41and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a
42device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel
43application might use the geomagnetic field sensor and accelerometer to report a compass
44bearing.</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045
Bill Gruberf8c029e2011-11-01 09:31:57 -070046<p>The Android platform supports four broad categories of sensors:</p>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047
Bill Gruberf8c029e2011-11-01 09:31:57 -070048<ul>
49 <li>Motion sensors
50 <p>These sensors measure acceleration forces and rotational forces along three axes. This
51 category includes accelerometers, gravity sensors, gyroscopes, and rotational vector
52 sensors.</p>
53 </li>
54 <li>Environmental sensors
55 <p>These sensors measure various environmental parameters, such as ambient air temperature
56 and pressure, illumination, and humidity. This category includes barometers, photometers, and
57 thermometers.</p>
58 </li>
59 <li>Position sensors
60 <p>These sensors measure the physical position of a device. This category includes
61 orientation sensors and magnetometers.</p>
62 </li>
63</ul>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064
Bill Gruberf8c029e2011-11-01 09:31:57 -070065<p>To access these sensors, you can use the Android sensor framework. The sensor framework provides
66several classes and interfaces that help you perform a wide variety of sensor-related tasks. To
67learn more about the framework and the sensors that are supported on the Android system, read the
68following documents:</p>
69
70<dl>
71 <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_overview.html">Sensors
72 Overview</a></strong></dt>
73 <dd>Learn how to list the sensors that are on a device, set up sensor event listeners, and
74 acquire sensor data. Also learn best practices for accessing and using sensors.</dd>
75 <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_motion.html">Motion
76 Sensors</a></strong></dt>
77 <dd>Learn how to use the sensors that provide acceleration data, such as the accelerometer,
78 gravity sensor, and linear acceleration sensor. Also learn how to use the sensors that
79 provide rotational data, such as gyroscopes and rotational vector sensors.</dd>
80 <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_position.html">Position
81 Sensors</a></strong></dt>
82 <dd>Learn how to use the sensors that provide orientation and compass data, such as the
83 orientation sensor and the geomagnetic field sensor.</dd>
Bill Gruber1d56f412011-12-19 17:32:47 -080084 <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_environment.html">Environment
Bill Gruberf8c029e2011-11-01 09:31:57 -070085 Sensors</a></strong></dt>
86 <dd>Learn how to use the sensors that provide environmental data, such as the light,
87 humidity, pressure, temperature, and proximity sensors.</dd>
88</dl>