Files
android_development/pdk/docs/guide/gps.jd
David Warren 5f6ca4f519 AI 148105: Assigning to Ryan for Dr No Approval.
These are new content files for the partner development kit that will be hosted off of source.android.com externally.

Automated import of CL 148105
2009-04-30 17:11:58 -07:00

57 lines
2.2 KiB
Plaintext
Executable File

page.title=GPS
pdk.version=1.0
@jd:body
<a name="toc"/>
<div style="padding:10px">
<a href="#androidGpsIntroduction">Introduction</a><br/>
<a href="#androidGPSBuildingDriver">Building a GPS Library</a><br/>
<a href="#androidGPSInterface">Interface</a><br/></div></font></div>
<a name="androidGpsIntroduction"></a><h2>Introduction</h2>
<p>Android defines a user space C abstraction interface for GPS hardware. The interface header is defined in <code>include/hardware/gps.h</code>. In order to integate GPS with Android, you need to build a shared library that implements this interface. </p>
<a name="androidGPSBuildingDriver"></a><h2>Building a GPS Library</h2>
<p>To implement a GPS driver, create a shared library that implements the interface defined in <code>gps.h</code>. You must name your shared library <code>libgps.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. Place GPS sources and Android.mk in <code>partner/acme/chipset_or_board/gps/</code> (where "acme" is your product name and "chipset_or_board" is your hardware target).</p>
<p>The following stub <code>Android.mk</code> file ensures that <code>libgps</code> compiles and links to the appropriate libraries:</p>
<pre class="prettify">
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libgps
LOCAL_STATIC_LIBRARIES:= \
# include any static library dependencies
LOCAL_SHARED_LIBRARIES := \
# include any shared library dependencies
LOCAL_SRC_FILES += \
# include your source files. eg. MyGpsLibrary.cpp
LOCAL_CFLAGS += \
# include any needed compile flags
LOCAL_C_INCLUDES:= \
# include any needed local header files
include $(BUILD_SHARED_LIBRARY)
</pre>
<a name="androidGPSInterface"></a><h2>Interface</h2>
<p><span class="lh2"><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="gps.html">click here</a>.</p>
<iframe onLoad="resizeDoxFrameHeight();" src="gps_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>