Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,804,192 Members 38,322 Now Online
XDA Developers Android and Mobile Development Forum

Understanding Android GPS Architecture

Tip us?
 
greatanjum
Old
(Last edited by greatanjum; 24th December 2012 at 07:02 AM.) Reason: Adding Detail
#1  
Junior Member - OP
Thanks Meter 56
Posts: 10
Join Date: Nov 2012
Phone Understanding Android GPS Architecture

Plz see the Attached GPS Architecture diagram 1st before reading below Article:
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

Now Lets Understand each

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)
http://forum.xda-developers.com/show....php?t=1318892

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.
Attached Thumbnails
Click image for larger version

Name:	Architecture.JPG
Views:	5159
Size:	25.4 KB
ID:	1587892  
The Following 50 Users Say Thank You to greatanjum For This Useful Post: [ Click to Expand ]
 
dewadg
Old
#2  
dewadg's Avatar
Senior Member
Thanks Meter 271
Posts: 309
Join Date: Jun 2012
Location: Denpasar

 
DONATE TO ME
Wow, thank you, this is very useful!
Google Nexus 4 16 GB / dewadgKernel / Github
 
RknDroidFreak
Old
#3  
RknDroidFreak's Avatar
Senior Member
Thanks Meter 45
Posts: 174
Join Date: Jul 2011
Location: Pokhara
Neat! Thanks!
 
jean2323
Old
#4  
Senior Member
Thanks Meter 6
Posts: 103
Join Date: Sep 2010
hi

can you please explain the extensive location settings from google maps ... i searched google's help and i'm still confused.

for eg, what is the difference between "report from this device" and "enable location history"?

i guess they generate the trafic info using the data from our phones ... how?

thanx!

Happy Holidays! and Happy New Year!
 
ak074
Old
#5  
ak074's Avatar
Senior Member
Thanks Meter 106
Posts: 311
Join Date: May 2011
Quote:
Originally Posted by jean2323 View Post
hi

can you please explain the extensive location settings from google maps ... i searched google's help and i'm still confused.

for eg, what is the difference between "report from this device" and "enable location history"?

i guess they generate the trafic info using the data from our phones ... how?

thanx!

Happy Holidays! and Happy New Year!
'report from this device' is used in latitude. latitude allows you to share your location with your 'friends'. 'enable location history' is for you only and keeps a record of everywhere you go. or at least thats my understanding of it. hope this helps
 
brakke97
Old
#6  
brakke97's Avatar
Senior Member
Thanks Meter 180
Posts: 396
Join Date: Jul 2012
Location: Leuven
Thanks for this "sort of" schematic! Keep on making some new schematics!


My Contributions:
# Tutorial: How to make your own Android kernel!
# Explanation:What's the difference between Odex and Deodex?

Contact:
# Social: Twitter | Google+
 
mbbauk
Old
#7  
Member
Thanks Meter 1
Posts: 59
Join Date: Jan 2011
Location: London
Dude i dint think ill tamper with gps in my life but the info you provided is just to simple and cool. thanks
 
reinbeau
Old
#8  
reinbeau's Avatar
Retired Forum Moderator
Thanks Meter 4,690
Posts: 7,373
Join Date: Sep 2010
Location: South of Boston, MA
Quote:
Originally Posted by mbbauk View Post
Dude i dint think ill tamper with gps in my life but the info you provided is just to simple and cool. thanks
I agree. I've always enjoyed learning about gps starting from my Garmin iQue days. After suffering with the Captivate and that horrible gps it's nice to have a phone with fantastic gps and the ability to truly use it. Good stuff here!

Sent from my SG Note i317 via XDA Premium...I eat apples, not use them.
Ann - Not a man

Did you read the first post of the thread?

The real purpose of XDA explained in one post - Click here!

| Samsung US/Canada GSM|

Μολὼν Λαβέ
The Following User Says Thank You to reinbeau For This Useful Post: [ Click to Expand ]
 
best98
Old
#9  
best98's Avatar
Member
Thanks Meter 12
Posts: 66
Join Date: Aug 2006
Location: Philly

 
DONATE TO ME
Hi

Speaking about GPS, is there any onchip limitation regarding the speed or location that it should grab GPS signal ?

Someone told me that it may not be possible to make it work in a plane because of US rules and security.. or around some sensitive FBI or Governments buildings (that may have signal killers) ?

Thanks
Fully Running Android kitKat !!
Galaxy Note - 4.4 | HTC Desire - 4.4
 
jean2323
Old
#10  
Senior Member
Thanks Meter 6
Posts: 103
Join Date: Sep 2010
Quote:
Originally Posted by ak074 View Post
'report from this device' is used in latitude. latitude allows you to share your location with your 'friends'. 'enable location history' is for you only and keeps a record of everywhere you go. or at least thats my understanding of it. hope this helps
first ... with both disabled ... maps and search still search your location .. which is strange ...
second ... if i enable location history, but not report from the device ... there is no history ! or i don't know where to find it ... cause, indeed it's not in latitute ... you can select "report from the device" without selecting history ... not sure if anything happens ...

Happy New Year!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Share Your Thoughts Anonymously with A Minimalist Social Network

Nowadays, almost everyone has a second life onthe Internet. Among the best … more

Enable Heads Up Notifications For The Sprint Galaxy S3

Heads up notifications, in case you didn’t already know, are an experimental … more

Android One Goes Live in India!

Android One is a Google initiative set to bring an AOSP-like experience tosome emergingmarkets like India, … more

XDA and LeaseWeb: Win Free Server Trial and Moto 360

As you might recall from a previousBehind the Scenesarticle we wrote, XDA’s … more