Home | History | Annotate | Download | only in sensors
      1 page.title=Sensors
      2 @jd:body
      3 
      4 <div id="qv-wrapper">
      5   <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
     27 href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/os/RotationVectorDemo.html">
     28 API Demos (OS - RotationVectorDemo)</a></li>
     29       <li><a
     30 href="{@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>
     35 
     36 <p>Most Android-powered devices have built-in sensors that measure motion, orientation,
     37 and various environmental conditions. These sensors are capable of providing raw data with high
     38 precision and accuracy, and are useful if you want to monitor three-dimensional device movement or
     39 positioning, or you want to monitor changes in the ambient environment near a device. For example, a
     40 game might track readings from a device's gravity sensor to infer complex user gestures
     41 and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a
     42 device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel
     43 application might use the geomagnetic field sensor and accelerometer to report a compass
     44 bearing.</p>
     45 
     46 <p>The Android platform supports three broad categories of sensors:</p>
     47 
     48 <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>
     64 
     65 <p>To access these sensors, you can use the Android sensor framework. The sensor framework provides
     66 several classes and interfaces that help you perform a wide variety of sensor-related tasks. To
     67 learn more about the framework and the sensors that are supported on the Android system, read the
     68 following 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>
     84   <dt><strong><a href="{@docRoot}guide/topics/sensors/sensors_environment.html">Environment
     85         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>
     89