Understanding Android GPS Architecture

I am Describing all this, Because Most of the Customers that Purchases Cheap Chinese Android Sets (QMobile,GFive, Voice e.t.c)  Complaint about issues  related to the GPS (Location Service), and find no Solution, The article is to self solve those issues although somewhat Technical.

you could also see this of my article on XDA-Developers.GPS Architecture

Location Services using GPS in Android consist of following Architectural Components

1) GPS Chip
2) GPS Driver
3) GL Engine
4) Android Framework
5) User Applications

GPS Chip: Radio Frequency Receiver that directly communicates with GPS Satellites

GPS Driver: GPS Driver System Software that uses Low level API’s to Communicate with the GPS chip, at the system level it may consist of a single or multiple files located at /System/Lib/hw/ Or /Vendor/Lib/hw/ files names usually starts with Prefix GPS and Postfix So (i.e gps.default.so or gps.aries.so e.t.c) depending upon the Android version and Smartphone Platform.

GL Engine: Actually the heart of this overall system.

At System level it consist of files at Path /system/bin with names like glgps or gpsd (Platform Specific)

It works using the Configuration Parameters which consist of .xml and .conf files (i.e glconfig.xml, gps.xml, Jupiter.xml, gpsconfig.xml and gps.conf, secgps.conf e.t.c). The Physical Location and names of files again depends upon Android version and Platform, but they are mostly at (/system/etc , /system/etc/gps , /vendor/etc/, /data/gps e.t.c), depending upon the Configuration and Platform, it takes initial Location Information from Cell Towers, then it take it read NVRAM , it is most important as here it store assistance data from GPS Lock, and it may also use xtra data.

NVRAM information is mostly location at /data/gps in a file with .sto ext (i.e gldata.sto) and xtra data files (lto.dat, xtra.bin, epo.dat e.t.c Platform dependent),

Using all this information Gl Engine instruct / Assist the GPS Driver, mostly Gl Engine is able to Detect multiple GPS satellites for which it is GPS driver is Programmed, but to Lock it need some extra information (Timing, Alm. / Emp.e.t.c) which it could either download from GPS satellites (Standalone Mode: very slow speed bits/sec.) or it could use internet to access SUPL/NTP servers (MS Based/MS Assisted Fast speed MB/sec.)

After all this activity, it saves all the data in NVRAM for future use.

Android Location Services : It consist of Android Framework Classes like Location Manager that Provide services to the use applications using the GL Engine.

User Applications: Location services Applications like Google Maps, Sygic, Navigon , TomTom e.t.c.

Keeping all this information in mind now lets see how the GPS Faster Fix Solutions in Market do.

Faster Fix Solutions like GPS Status & Tool Box, GPS Test, GPS Doctor e.t.c mostly handle two things.

1)      Download XTRA Data (lto.dat , xtra.bin , epo.dat, gldata.sto e.t.c)

2)      Modify GPS.conf (Root Required)

But this not always works.

Devices uses Google as Supl Server but most devices are unable to use it due to invalid/expired certificates and Google servers rejects the Assistance requests in such scenario Users should use SUPL.NOKIA.COM:7275 , which although slow (but something is better then nothing)

If something is wrong with GL Engine or GPS Driver, it may need Re flashing but a little could be done if GPS Chip Reception is Low or Problem is at Hardware Level, some time need soldering skills for hardware alteration (Risky)


The Other Configuration Parameter which users could modify is xml Configuration file( Take Backup 1st) at Least a Programmer could get Debug Log to understand where things are going wrong, using below parameters.

cLogEnabled=”true” acLogDirectory=”/sdcard/gps” and LogPriMask, LogFacMask and also DEBUG_LEVEL (gps.conf)

Hope everyone could easily improves their GPS Performance using this guide for any platform by them Self.

Peoples also Complaints about the Abnormal GlEngine stop during the GPS lock, (QMobile NOIR)

I have Diagnosed the Cause but the Solution varies depending upon the Platform.

Problem is due to InCorrect calculation of Time by GlEngine when it is using NVRAM as timesource, GlEngine is neither using NTP Servers nor Cell Towers as timing source, it is only using either NVRAM time (Calculated) by default or GPS time (Download),
now if it using NVRAM as time source,

14:25:35.464 $081969I FixStatus: TimeSource 1
14:25:35.464 –GlPe_FixStatus::SetSIGMeasuement Setting utc time to 2012 (yr) 11 (mo) 25 (dt) 9 (hr) 5 (mn) 14 (sec) 565 (ms) 0 (us) 1000000 (prec)

It mostly Stops Abnormally. But on the next Startup, it resets it time to year 2007 or back, and use GPS provided time as source.

21:56:02.218 $134952I FixStatus: TimeSource 0
21:56:02.218 –GlPe_FixStatus::SetSIGMeasuement Setting utc time to 2007 (yr) 3 (mo) 31 (dt) 23 (hr) 59 (mn) 58 (sec) 79 (ms) 0 (us) -1 (prec)

in that case it takes a little time but do not shutdown and using Supl Server it could easily locks and remain Locked but from next time it again use time stored in NVRAM as stored, which could again give similar result.

Solution is to Modify XML configuration files to use GPS satellites as default time source and ignore NVRAM stored time or Replace the GlEngine, but again Configuration Parameters and GLEngine Varies Depending upon the Platform, So a Single Solution could not be applied every where, need self diagnose and Solve.

INCPak Team


  1. Hi,

    I am using imx6sl processor,Android 4.0.4,gps
    module(Telit Jupiter SE880) with UART(/dev/ttymxc2 baud rate 4800)
    interface,I could able to get data in my shell prompt when i cat
    uart.But none of gps test applications are working.Can you please
    provide me proper HAL which will implement all the interfaces of GPS.

    As we confirmed our gps module working properly,and getting data in
    kernel level.(by cating in shell prompt)its only problem with my HAL.We
    are trying to fix this since couple of weeks,gps HAL is very critical
    for us, Please provide me proper HAL(.so) layer asap

Leave a Reply

Your email address will not be published.

Back to top button