How to enable GPS?

237 views
Skip to first unread message

Gianmaria Iaculo

unread,
Apr 14, 2015, 2:32:43 PM4/14/15
to android...@googlegroups.com

Hello,

I'm porting GPS HAL on android 4.4. Tha's what I've done till now.  

1) I started with freerunner_gps.c cause it seem the simplest solution, and it clearly works with a serial nmea port, wich is right my case. I've a ttyUSB1 wich produces just NMEA sentences. 

2) I've created a directory:

android/hardware/libhardware_legacy/gps

and placed freerunner_gps.c  , a link to referenced gps.h pointing at 

android/hardware/libhardware/include/hardware/gps.h

and created an Android.mk so simple:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
LOCAL_PATH := $(call my-dir)
 
  include $(CLEAR_VARS)
 
  LOCAL_SRC_FILES := \
    gps_freerunner.c
 
  LOCAL_MODULE := libgps.telit
 
  LOCAL_SHARED_LIBRARIES := \
    libutils \
    libcutils \
    libdl \
    libc
 
  include $(BUILD_SHARED_LIBRARY)



it produces a libpgs.telit.so in output folder /system/lib

3) I added to my BoardConfig.mk the following:

BOARD_GPS_LIBRARIES := libgps.telit

4) in my build.prop i added this line ro.kernel.android.gps=/dev/ttyUSB1 
Where USB1 is a working serial that produces NMEA.

After this, i checked if everything on board is ok, all files are in place. But I absolutely cant see any debug line or initialization string. 

It seems I have to do something else to enable the GPS part.. Android at moment is copletly ignoring this hardware. 

Any suggest?

Regards,
Gianmaria

Amit Kulkarni

unread,
May 21, 2015, 10:16:50 AM5/21/15
to android...@googlegroups.com
Did you get any success ??

dimi...@android.com

unread,
May 21, 2015, 5:37:09 PM5/21/15
to android...@googlegroups.com
If you want Android system to be aware of GPS you may need to add:

PRODUCT_COPY_FILES += \
    frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml

Reply all
Reply to author
Forward
0 new messages