Android GPS

1,429 views
Skip to first unread message

bridgette

unread,
Jun 9, 2010, 3:53:34 PM6/9/10
to android-porting
I have created a shared library, libgps.so that implements the gps.h
in order to
use a GPS receiver with Android and the libgps.so file was installed
into the
system/lib when the build completed.

I get the following from logcat...libhardware_legacy( 772): no GPS
hardware on this device.

In the hardware/libhardware_legacy/gps/gps.cpp file, a
HAVE_GPS_HARDWARE flag is wrapped around
the call to the gps_get_hardware_interface()...in the same directory,
I set BOARD_GPS_LIBRARIES
yet I still get the "no GPS hardware..." message.

BOARD_GPS_LIBRARIES := libgps.so

ifneq ($(BOARD_GPS_LIBRARIES),)
LOCAL_CFLAGS += -DHAVE_GPS_HARDWARE
LOCAL_SHARED_LIBRARIES += $(BOARD_GPS_LIBRARIES)
endif


Any suggestions?


Thanks.

Deva R

unread,
Jun 9, 2010, 4:42:27 PM6/9/10
to tbrid...@yahoo.com, android-porting

probably it expects a library libgps.default.so or libgps.<hwname>.so

you can check hw_get_module() call in ./hardware/libhardware/hardware.c
http://git.omapzoom.org/?p=platform/hardware/libhardware.git;a=blob;f=hardware.c;h=3a23b1f6b71eb576c6f2f7161503e69e821b8083;hb=p-eclair

You can add more tract to hw_get_module() [ http://goo.gl/ndQ3 ] to see why library loading is failing.

What is your hardware platform name, initialized with TARGET_BOARD_PLATFORM in your build??
Accordingly, try modifyig Android.mk as
  LOCAL_MODULE := libgps.$(TARGET_BOARD_PLATFORM)
  or
  LOCAL_MODULE := libgps.default

-Deva





Mikkel Christensen

unread,
Jun 11, 2010, 1:59:21 AM6/11/10
to android-porting
hi,

You need to add BOARD_GPS_LIBRARIES := "libgps" to whatever
BoardConfig.mk file you are using.

Then run "touch hardware/libhardware_legacy/gps/gps.cpp" and recompile
to pick up the changes.

Best regards,
Mikkel


On Jun 9, 10:42 pm, Deva R <r.deva...@gmail.com> wrote:
> probably it expects a library libgps.default.so or libgps.<hwname>.so
>
> you can check hw_get_module() call in ./hardware/libhardware/hardware.chttp://git.omapzoom.org/?p=platform/hardware/libhardware.git;a=blob;f...
> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsubscribe@ googlegroups.com>
> > website:http://groups.google.com/group/android-porting

bridgette

unread,
Jul 7, 2010, 9:49:28 AM7/7/10
to android-porting
thanks for the input...I did get this working a while back.



On Jun 11, 12:59 am, Mikkel Christensen
<mikkel.christen...@ixonos.com> wrote:
> hi,
>
> You need to add BOARD_GPS_LIBRARIES := "libgps" to whatever
> BoardConfig.mk file you are using.
>
> Then run "touch hardware/libhardware_legacy/gps/gps.cpp" and recompile
> to pick up the changes.
>
> Best regards,
>  Mikkel
>
> On Jun 9, 10:42 pm, Deva R <r.deva...@gmail.com> wrote:
>
> > probably it expects a library libgps.default.so or libgps.<hwname>.so
>
> > you can check hw_get_module() call in ./hardware/libhardware/hardware.chttp://git.omapzoom.org/?p=platform/hardware/libhardware.git;a=blob;f...
>
> > You can add more tract to hw_get_module() [http://goo.gl/ndQ3] to see why
> > library loading is failing.
>
> > What is your hardware platform name, initialized with TARGET_BOARD_PLATFORM
> > in your build??
> > Accordingly, try modifyigAndroid.mk as
> >   LOCAL_MODULE := libgps.$(TARGET_BOARD_PLATFORM)
> >   or
> >   LOCAL_MODULE := libgps.default
>
> > -Deva
>
> > On Thu, Jun 10, 2010 at 1:23 AM, bridgette <tbridge...@yahoo.com> wrote:
> > > I have created a shared library, libgps.so that implements thegps.h
> > > in order to
> > > use aGPSreceiver withAndroidand the libgps.so file was installed
> > > into the
> > > system/lib when the build completed.
>
> > > I get the following from logcat...libhardware_legacy(  772): noGPS
> > > hardware on this device.
>
> > > In the hardware/libhardware_legacy/gps/gps.cpp file, a
> > > HAVE_GPS_HARDWARE flag is wrapped around
> > > the call to the gps_get_hardware_interface()...in the same directory,
> > > I set BOARD_GPS_LIBRARIES
> > > yet I still get the "noGPShardware..." message.

Aaron Mills

unread,
Jul 22, 2010, 3:45:42 PM7/22/10
to android-porting
Bridgette -- could you please briefly describe what you did that
worked? Did you need to download the entire platform source code to
build libgps.so?

bridgette

unread,
Jul 23, 2010, 11:53:23 AM7/23/10
to android-porting
I created a gps directory and placed my gps source code there (i.e
<ANDROID_PATH>/vendor/acme/board/gps), created a Android.mk file in
that same directory and listed my sources and added
LOCALE_MODULE :=libgps to ensure the module is compiled.

next, I added the BOARD_GPS_LIBRARIES := "libgps" to the
<ANDROID_PATH>/vendor/acme/board/BoardConfig.mk

then, I touched the hardware/libhardware_legacy/gps/gps.cpp and
recompiled from the top (i.e <ANDROID_PATH>/).

hope that helps.

feng

unread,
Jul 29, 2010, 8:57:58 AM7/29/10
to tbrid...@yahoo.com, android-porting
hi
i do the same
but i compile the code ,and ld error,  the gps_get_hardware_interface can not be found, the libgps.devkit8000.so can not find the libfreerunner_gps.so
i use freerunner_gps as my hw code.!

BRs

feng

>
>-- 
>unsubscribe: android-porti...@googlegroups.com
>website: http://groups.google.com/group/android-porting



您想拥有和网易免费邮箱一样强大的软件吗?
Reply all
Reply to author
Forward
0 new messages