blob: 79a2ad3f9ef0be10639e708236c45f8fae990ab3 [file] [log] [blame]
Reena Leec3c74792009-05-18 22:34:25 -07001page.title=Sensors
2pdk.version=1.0
3@jd:body
David Warren5c40a482009-06-05 15:11:21 -07004
5<div id="qv-wrapper">
6<div id="qv">
7<h2>In this document</h2>
8<a name="toc"/>
9<ul>
10<li><a href="#androidSensorsInterface">Interface</a></li>
11</ul>
12</div>
13</div>
14
Reena Leec3c74792009-05-18 22:34:25 -070015<p>Android defines a user space C abstraction interface for sensor hardware. The interface header is defined in
16<code>hardware/libhardware/include/hardware/sensors.h</code>.
17In order to integrate sensors with Android you need to build a shared library that implements this interface.
18
19The types of sensors currently supported by Android include:
20<ul>
21<li>Accelerometer</li>
22<li>Magnetic Field</li>
23<li>Orientation</li>
24<li>Gyroscope</li>
25<li>Light</li>
26<li>Pressure</li>
27<li>Temperature</li>
28<li>Proximity</li>
29</ul>
30</p>
31
David Warren5c40a482009-06-05 15:11:21 -070032<a name="androidSensorBuildingDriver"></a><h3>Building a Sensor Library</h3>
Reena Leec3c74792009-05-18 22:34:25 -070033<p> To implement a Sensors driver, create a shared library that implements the interface defined in <code>sensors.h</code>. You must name your shared library
34<code>libsensors.so</code> so that it will get loaded from <code>/system/lib</code> at runtime.
35</p
36
37
David Warren5c40a482009-06-05 15:11:21 -070038<a name="androidSensorsInterface"></a><h3>Interface</h3>
Reena Leec3c74792009-05-18 22:34:25 -070039
40
41
David Warren5c40a482009-06-05 15:11:21 -070042<p><span class="lh3"><a name="androidDoxygenNote"></a></span>
Reena Leec3c74792009-05-18 22:34:25 -070043
44<p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="sensors.html">click here</a>.</p>
45
46
47<iframe onLoad="resizeDoxFrameHeight();" src="sensors_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0"
48frameborder="0" style="width:100%;"></iframe>