Original author: mritter Merged from: //branches/cupcake/... Automated import of CL 144166
50 lines
1.7 KiB
Plaintext
Executable File
50 lines
1.7 KiB
Plaintext
Executable File
page.title=GPS
|
|
@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>
|
|
|
|
<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>
|
|
|
|
|
|
|