blob: 79a2ad3f9ef0be10639e708236c45f8fae990ab3 [file] [log] [blame]
page.title=Sensors
pdk.version=1.0
@jd:body
<div id="qv-wrapper">
<div id="qv">
<h2>In this document</h2>
<a name="toc"/>
<ul>
<li><a href="#androidSensorsInterface">Interface</a></li>
</ul>
</div>
</div>
<p>Android defines a user space C abstraction interface for sensor hardware. The interface header is defined in
<code>hardware/libhardware/include/hardware/sensors.h</code>.
In order to integrate sensors with Android you need to build a shared library that implements this interface.
The types of sensors currently supported by Android include:
<ul>
<li>Accelerometer</li>
<li>Magnetic Field</li>
<li>Orientation</li>
<li>Gyroscope</li>
<li>Light</li>
<li>Pressure</li>
<li>Temperature</li>
<li>Proximity</li>
</ul>
</p>
<a name="androidSensorBuildingDriver"></a><h3>Building a Sensor Library</h3>
<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
<code>libsensors.so</code> so that it will get loaded from <code>/system/lib</code> at runtime.
</p
<a name="androidSensorsInterface"></a><h3>Interface</h3>
<p><span class="lh3"><a name="androidDoxygenNote"></a></span>
<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>
<iframe onLoad="resizeDoxFrameHeight();" src="sensors_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0"
frameborder="0" style="width:100%;"></iframe>