[T-Mobile myTouch 4G Slide] Blue6IX:
UPDATE:

Flash this file if not using the Bulletproof ROM to reset your GPS configuration file correctly:

T-Mo GPS Configuration Fix

md5 = 62df031a03919af49194a7a66e78463a

See Post 27 for an explanation of what this flashable zip will do to your device.

ATT USERS:

ATT GPS Configuration Fix

md5 = 9505d2ac0aee629536567799b78e9854

----

Please see this post: Post 25 of this thread to see what I need to make this flashable patch for you.

Other carriers: Also see post 25 linked above for ATT users - I need the same two files from a phone on your providers service ( one that came on the service and has the carrier default files ) to be able to make this patch work on whatever carrier you use. It doesn't matter what phone they come from, just has to be an android phone ( gingerbread ) from that carrier.

Help me help you!

--------

Non-Bulletproof users:

The stock build.prop also has three issues that I set which you will need to edit:

ro.ril.def.agps.feature=1

ro.ril.def.agps.mode=1

And you will find a third entry that mirrors one of these near the middle-bottom of the file you will have to delete.

Make those two lines look like what I have posted here, and delete the duplicate third entry near the middle-bottom to correctly enable your AGPS capability of the device. This must be done in addition to flashing the correct configuration file I posted a link to above.

--------

To implement the signal tweaks Undeadk9 came up with:

Read this post, Post 26 to see the build.prop file from the old flashable zip attached to this thread.

You will have to comb through it to figure out what the signal tweaks Undeadk9 made that were the other half of the GPS solution.

I am unable to provide you with more information at this time to resolve that, but it's all laid out for you in post 26.

--------

Following is the rest of the original first post in the thread:

--------

Half the answer is what this thread explains, Undeadk9 came up with the other half. GPS lock in 24 seconds or less from a cold start, every time.

To install the update: download the zip to your sdcard. Reboot into recovery, choose 'install zip from sdcard' and pick the zip you downloaded from this thread.

The update does everything for you, but it does mean clearing your data partition - you will lose all saved phone numbers, downloaded apps and so forth - back up your data first. See my sig for a link to a backup guide.

You could extract the zip and apply the files individually to your phone, but there are references all over your data partition that will inhibit this update from working to the fullest that way. I highly recommend flashing the zip.

DISCLAIMER: I am not responsible if you hose your system doing this. Make backups of the files you are working with, and just to be safe make a nandroid in CWM as well. It only takes a few minutes, and can save you a ton of headache later.

Warning:This thread is a long read. It will be an in-depth and explanatory review of how to fix your A-GPS capabilities of your phone. While some of this info may pertain to other handsets, it is focused on the doubleshot (myTouch 4G Slide).

UPDATES:

08/25/2011 - Updated NTP Pool list after delving further into the NTP Site. Restructured First post a bit to better reflect the evolving nature of this thread.

08/27/2011 - Updated Post 1 with an example gps.conf including specific time server addresses. Updated Post 3 to explain what they are and how to use them. Re-organized the next few posts in the thread so it reads better.

Updates explained:

I will be updating the main posting to reflect an evolving understanding of how the gps.config file can be written to improve A-GPS functionality. I will remove and post the old "updated" file from the first posting and post it as a reply to the thread, both to bump the thread for updates and show what didn't work as the file evolves.

This first posting will always have the "default" stock file, followed by the most current working version of gps.conf . No working version of gps.conf will make it to this first posting unless i've tested for several days over miles of countryside around my home. My job requires a lot of travel in my area, so I get the opportunity to test it without going out of my way. I will not simply repeat untested hear-say into this post, i'd like people to know that it was tried and tested information when referring to this thread.

I'd ask people to please refrain from quoting the whole first post, as it's large and only getting larger, and the information is subject to change. My posting the old edits below should allow people to see how this evolves over time and eliminate that need.

Further, this will be focused on the United States in the Northeast which is where I live. I'll link up all my information so that people from other countries and places can figure out how to edit for their specific region. The longer this thread runs, the more specifically it will target my location so you will have to do some of your own homework to make it work for you if you don't live near me.

I will be happy to reply below with (and if necessary transfer to this first posting) any relevant information I can find if people can't figure out how to do it on their own.

Moving on: (back into the original post: )

Sometimes my GPS takes forever to lock on to my location. This was true both before and after root. Now that we have root, we can do something about it besides get frustrated with our devices.

Now, I reported Here that my GPS capabilities on the device didn't seem to get better or worse after root, which is true. It wasn't so great before, and it wasn't so great after. The device always got a lock...eventually, but more often then not it took an unacceptable amount of time to do so.

One of the reasons I bought this device was to replace my aging standalone GPS unit, so this is something i've spent more then just a passive amount of time looking into.

The good news?

After making a few changes to the GPS configuration file on my device I now get a lock much more quickly. You will too after reading through and then following the guide below.

What you need:

-Root (superuser access to your phone)

-Root Explorer (paid app, and worth every penny)

-Web access, to get to the site: http://www.pool.ntp.org/en/

We will be working with two files on your device:

/etc/gps.conf

/system/etc/gps.conf

Use Root Explorer to copy each file, one at a time, and back them up to a safe place on your /sdcard

(I made a folder called "Misc1" on my sdcard, and made a second folder inside it called "System1". /etc/gps.conf went into the "Misc1" folder, and /system/etc/gps.conf went into the "System1" folder. Since both files have the same name, they have to be placed in seperate folders to keep from overwriting. This also helps you remember which one went where.)

*One thing to note is that changes made to one file are automatically mirrored to the other, so you need to make sure you backed up both before you start.

Root Explorer will make a backup of the gps.conf file in the directory you are working on it in, which you can ignore. After verifying that it all works, you can safely delete this backup file. I would make sure to file away the original files you backed up manually, just in case you need them someday.

Now is the time to make that CWM nandroid if you are going to do so.

Since we've made our backups, it's time to dig in and fix things:

Everything is case sensitive, so make sure you type it all in the right way.

First, disable wireless and mobile networks on your device. Turn off the GPS, and then reboot your phone.

Once you are back on, open Root Explorer and navigate to /system/etc

Press "Mount R/W" at the top of the app, so you switch to read/write instead of read only. This will allow you to make changes to files.

Scroll down the /system/etc folder until you find the file "gps.conf"

Long press the file, and select "Open in text editor"

Your file should look like this:

NTP_SERVER=north-america.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
SUPL_HOST=10.176.29.255
SUPL_PORT=7275
SUPL_TLS_HOST=lbs.geo.t-mobile.com
SUPL_TLS_CERT=/etc/SuplRootCert
PHONE_TYPE=UMTS

(SUPL_HOST=10.176.29.255 may have a different static ip for you, that's okay.)

Change it to read this instead: (changes in bold)

[B]NTP_SERVER=0.us.pool.ntp.org
NTP_SERVER=1.us.pool.ntp.org
NTP_SERVER=2.us.pool.ntp.org
NTP_SERVER=3.us.pool.ntp.org
NTP_SERVER=0.north-america.pool.ntp.org
NTP_SERVER=1.north-america.pool.ntp.org
NTP_SERVER=2.north-america.pool.ntp.org
NTP_SERVER=3.north-america.pool.ntp.org[/B]
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
[B]SUPL_HOST=supl.google.com[/B]
SUPL_PORT=727[B]6[/B]
SUPL_TLS_HOST=lbs.geo.t-mobile.com
SUPL_TLS_CERT=/etc/SuplRootCert
PHONE_TYPE=UMTS

Save your change, then make sure the same thing has been changed in /etc/gps.conf

If both files match, exit Root Explorer and reboot your phone.

Turn on your GPS & mobile data, go outside, and pop open Google Maps. Tell it to lock onto your location, and you should get a lock pretty quickly.

The very first time you try to lock, it may take a bit longer to happen. Thereafter it should always be quicker, and as this thread matures we'll look into making sure our A-GPS data is kept up to date.

That is how the file should look if you are in North America. If you are elsewhere, then go to http://www.pool.ntp.org and locate your country to see how many servers you need to put in. You find your country by clicking on it on the right hand side of the page.

For advanced users: ( Added August 27th, 2011 )

( Please read

Post 3

in this thread before making any changes like this to your gps.conf file - you can make your A=GPS much worse if you do not know what you are doing )

( If you don't understand what was done here, and why - you can stick to the general edits above without worry. This is much more specific and these server addresses should be different, depending on where you actually are.

If you go to a far enough away geographic location then what these edits are specifically made for, you will need to update this file with the server addresses of your new location. )

[B]NTP_SERVER=128.118.46.3
NTP_SERVER=wwv.tns.its.psu.edu
NTP_SERVER=209.51.161.238
NTP_SERVER=152.1.58.124
NTP_SERVER=time.keneli.org
NTP_SERVER=time.falk.us
NTP_SERVER=18.26.4.105
NTP_SERVER=ntp.your.org
NTP_SERVER=ntp1.conectiv.com
NTP_SERVER=128.4.1.2[/B]
NTP_SERVER=0.us.pool.ntp.org
NTP_SERVER=1.us.pool.ntp.org
NTP_SERVER=2.us.pool.ntp.org
NTP_SERVER=3.us.pool.ntp.org
NTP_SERVER=0.north-america.pool.ntp.org
NTP_SERVER=1.north-america.pool.ntp.org
NTP_SERVER=2.north-america.pool.ntp.org
NTP_SERVER=3.north-america.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
SUPL_HOST=supl.google.com
SUPL_PORT=7276
SUPL_TLS_HOST=lbs.geo.t-mobile.com
SUPL_TLS_CERT=/etc/SuplRootCert
PHONE_TYPE=UMTS

This is an advanced configuration that includes specific publically available time servers, configured for my region. This third example of a gps.conf file is only good for someone in the northeast corridor of the United States.

It includes specific Stratum 1 time servers from the states of: DE, IL, MA, NC, NY & PA.

This is only an example, but represents my current gps.conf file as of the morning of August 27th, 2011, which I have been successfully using for several days now.

( I am finding it difficult to tell whether the A-GPS function is capable of handling static IP addresses that don't support DNS, but it seems to help. It will take much more time and testing to know for sure. )

It does not yet include any Stratum 2 time servers, which i'll be testing more thoroughly over the next few days. I will not be posting an updated gps.conf file to reflect those changes, all the information you need has been provided between this post and post 3 of this thread.

Cramming a whole mess of specific time servers into your gps.conf file, beyond what's listed on the main NTP website will cause your A-GPS capabilities of your phone to act erratically and unrealiably. Post 3 of this thread provides an in-depth explanation as to why.

Basically, if you don't know what you're doing, don't mess with it the way this third gps.conf example shows unless you are okay with the fact that it may not work well until you fix what you ( possibly ) broke.

Otherwise, it's a great learning experience if you're up for it. I think we have now covered time servers pretty completely.

My contributions to this thread will no longer revolve around time servers ( unless people post questions below ). What I will be focusing on moving forward will be the configuration changes that can be made further down the file to control specific A-GPS / GPS functions directly.

( End of additions from August 27th, 2011 )

Why make these changes?

The default way our gps.conf file tries to talk to the NTP server is to just shoot for something in North-America. This is no good, because you spend too much time trying to resolve what servers are available and waste time on network discovery. Because there is no way of telling where the phone you bought would end up being sold, this is a balance so that everyone has the same chance to get a fix.

If you are reading this, then you are rectifying that situation by more accurately telling your phone where to go to find it's information closer to you, instead of spamming the whole network for an answer.

See This link for more information on how to use general pool servers.

You can see by going to the NTP site that North America has 4 servers, numbered 0, 1, 2 and 3. By default, the GPS configuration file only tries to use randomly 1 of these 4 servers, which is why we added the lines:

NTP_SERVER=0.north-america.pool.ntp.org

NTP_SERVER=1.north-america.pool.ntp.org

NTP_SERVER=2.north-america.pool.ntp.org

NTP_SERVER=3.north-america.pool.ntp.org

...so our device knew there were 4 and where they were.

Scrolling a little further down on the North-America page of the NTP website, we see links for the different countries included in North-America, one of which is "United States". Clicking on this link brings us to a new page that shows us another pool of servers we can use to fix our position, which is why we added the lines:

NTP_SERVER=0.us.pool.ntp.org

NTP_SERVER=1.us.pool.ntp.org

NTP_SERVER=2.us.pool.ntp.org

NTP_SERVER=3.us.pool.ntp.org

...which gives us another 4 servers to check.

Further, the static IP that was in my configuration file (and yours may be different) does not work anywhere near as well as using SUPL_HOST=supl.google.com instead.

Lastly, i've tried a handful of ports, but SUPL_PORT=7276 absolutely made a difference in time to GPS lock. Using other ports in all cases increased the time to lock, and in almost all cases prevented a lock altogether in the amount of time I was willing to sit and wait for it. You will find this port recommended all over the internet when switching to supl.google.com.

(Added August 29th, 2011)

SUPL name/port confirmed by a Google rep Here and is undoubtedly the source of this information.

Extracting "/system/framework/android.supl.jar" and then browsing "android.supl/SuplConfig.spl" shows:

<slphost_fqdn> 74.125.77.192 <port>7276

Networksolutions confirms that IP as registered to Google.

(end added August 29th, 2011)

If you are not in North America, I can't make any promises, but these changes should help as well. (updated for your country at the NTP link I provided, of course)

Some helpful definitions:

SUPL stands for Secure User Plane Location, and was developed by the Open Mobile Alliance to use IP networks as the data transport medium.

TLS (transport layer security) is a cyptographic protocol for secure internet communications, for LBS (location based services) privacy.

Anyways, hope this helps others with their GPS issues, I know it's made my problems evaporate.

Any problems, post below. I'll be happy to help as I can - just remember i'm not here around the clock.