Android defines a user space C abstraction interface for GPS hardware. The interface header is defined in include/hardware/gps.h. In order to integate GPS with Android, you need to build a shared library that implements this interface.

Building a GPS Library

To implement a GPS driver, create a shared library that implements the interface defined in gps.h. You must name your shared library so that it will get loaded from /system/lib at runtime. Place GPS sources and in vendor/acme/chipset_or_board/gps/ (where "acme" is your organization name and "chipset_or_board" is your hardware target).

The following stub file ensures that libgps compiles and links to the appropriate libraries:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := libgps

# include any static library dependencies

# include any shared library dependencies

# include your source files.  eg. MyGpsLibrary.cpp

# include any needed compile flags

# include any needed local header files



Note: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, click here.

↑ Go to top