[Captivate Android Development] chuby007:
hi.

Maybe this has been discussed over and over on XDA developers but not on this thread, and maybe I'll speak of stuff everyone knows but ok, gonna write it please do not flame me I'm trying to help.

This is about hopefully making your GPS work better, so I'm gonna do a small... nutshell intro on GPS and how they work

Basically GPS are satellites that have a known location ( we know the location based on math, however since the satellites drift there are tables that give us the drift to get better accuracy )

Each one of this GPS satellites has a supper duper accurate clock, that it sends, something like I'm GPS satellite 23 ( you know where I am ) and my current time is: xx:xx:xx:xx

So then you do some more math ( trigonometry ) and based on the time difference between the satellites, and you clock you can say where on earth are you ( literally )

ok, it seems that whenever possible our phones do not trust their time enough to geolocate us, so it keeps talking to a pool of servers called Network Time Protocol Servers or NTP pool, asking what's their time, with that the math and what I spoke up there it calculates our location

Basically a few Milliseconds (ms ) could create a lot of drift, from where we actually stand to where our position is calculated.

So based on this I did a few tests, I can't say 100% they are conclusive but they seem to show a thrend if someone wants to check it even further.

it seems that accuracy is better on faster networks 3g or wifi than 2g, and it makes some sense, 2g will have a lot more latency than 3g,4g,or wifi.

so the time it takes for the server to send the time to where we are causes some drift, so basically the better connection you have most likely the best position you will get, however, you might ask at this moment, hey I can get a GPS position when I'm NOT using my data plan.

Yes you can when you are not using your data plan our GPS seems to use the internal clock instead of the NTP server to calculate where wer are.

So personally I have seen that if my data plan is not active while using GPS it jumps a lot less, ( I think that since it has a constant time it does not correct as much ), when it has a data plan it seems to be more accurate but it also jumps a tad more ( of course it's not only the clocks but how many satellites we are looking at )

So a good way to fix this "lag" or drift is to actually use a NTP pool server located NEAR us, the closer the better, I've seen that the gps hacks use basically 2 servers europe and northamerica, but those servers go all over northamerica, even some parts that are not north america, like guatemala, costa rica, so you might get routed to a place where you will have a lot of lag.

so you could go to this place: http://www.pool.ntp.org and find for a pool sever near you here are some:

Canada — ca.pool.ntp.org (62)

United States — us.pool.ntp.org (537)

Mexico — mx.pool.ntp.org (5)

Guatemala — gt.pool.ntp.org (0)

Panama — pa.pool.ntp.org (5)

Bahamas — bs.pool.ntp.org (1)

Costa Rica — cr.pool.ntp.org (2)

El Salvador — sv.pool.ntp.org (3)

Austria — at.pool.ntp.org (43)

Switzerland — ch.pool.ntp.org (58)

Germany — de.pool.ntp.org (300)

Denmark — dk.pool.ntp.org (37)

Spain — es.pool.ntp.org (22)

France — fr.pool.ntp.org (142)

Italy — it.pool.ntp.org (24)

Luxembourg — lu.pool.ntp.org (5)

Netherlands — nl.pool.ntp.org (117)

Norway — no.pool.ntp.org (22)

Poland — pl.pool.ntp.org (36)

Sweden — se.pool.ntp.org (32)

Slovenia — si.pool.ntp.org (21)

United Kingdom — uk.pool.ntp.org (135)

Finland — fi.pool.ntp.org (38)

Ireland — ie.pool.ntp.org (19)

Russian Federation — ru.pool.ntp.org (82)

Belgium — be.pool.ntp.org (19)

Portugal — pt.pool.ntp.org (9)

Greece — gr.pool.ntp.org (6)

Hungary — hu.pool.ntp.org (41)

Bulgaria — bg.pool.ntp.org (23)

Romania — ro.pool.ntp.org (21)

Czech Republic — cz.pool.ntp.org (25)

Yugoslavia — yu.pool.ntp.org (4)

Estonia — ee.pool.ntp.org (4)

Belarus — by.pool.ntp.org (9)

Slovakia — sk.pool.ntp.org (5)

Ukraine — ua.pool.ntp.org (50)

Lithuania — lt.pool.ntp.org (2)

Macedonia — mk.pool.ntp.org (4)

Moldova — md.pool.ntp.org (6)

Latvia — lv.pool.ntp.org (11)

Croatia — hr.pool.ntp.org (4)

Republic of Serbia — rs.pool.ntp.org (7)

Bosnia and Herzegovina — ba.pool.ntp.org (1)

and others you can check the site, you change it on /system/etc/gps.conf there you change from one server to the other.

now there's another pool of data where our phones get position it is the AGPS ( asisted GPS ) the AGPS basically is a database of cell towers and sometimes wifi spots that try to pin-point you to a location

some people have changed this from the default to: supl.google.com that seems a fast server, but you could use any supl server so we do not load the google servers, I found that supl.nokia.com works with our phones.

I guess there are a ton other supl servers, but I have not looked for them

oh at last if you are concerned about the lag that I told that could cause drifting while on 2g or slow networks, if you are downloading like crazy ( like the actual satellite images) it could cause a LOT of lag.

So basically the least data you have to download maybe the better your gps work so instead of seeing satellite views, a good ol' Latitude only layer could be better.

Some of this information I have tested, some is empirical, but I think it is mostly correct, if I'm completely wrong just disregard the post THANKS !