[Android Software Development] cj chitwood:
I have searched several times, usually while on the road, so only now and then, but all total I must have searched for weeks worth of days trying to find an answer.

I found one.

What I wanted to do was take my T-Mobile G1's GPS receiver AND its Internet connection and forward both of these on to my laptop running Windows XP. I really would prefer a Linux solution, and I found one, but while in Linux my needs change slightly enough that the solution I found wasn't worth trying at that time. So I used Windows. As will most other people reading this, so.... >shrug<

I know it's not a very popular topic (not that it's non-popular; it's just that most people don't care enough to worry about it). However, that said, I know some poor pleb is out there trying to do exactly the same thing I found out how to do with exactly the same hardware and software, so I wanted to post how I did it.

MODS: I've not found anything detailing specifically this method on XDA and I did search before, but Google and I have been having communication problems in our relationship so I haven't been as proficient with results as usual. Therefore, if this has already been posted by someone else somewhere else, please forgive me, and feel free to pop a link in here, or merge, or whatever is appropriate. -- Thanks.

--------------------------------------------------

Required:

Rooted phone. which will require...

A computer with a USB port AND a WiFi device of some kind.

Install on the computer:

* the Android SDK

* com0com

* com2tcp - Which MIGHT be included in com0com, I don't remember.

* Something to use it with (Google Earth, for instance)

And on the phone, install the following:

* Android-Wifi-Tether (WiFi Tether for Root Users)

* ShareGPS <-- Just a link to a page with a QR code. The dev's page says to get it from Android Market.

That's a lot of stuff, but if you NEED this, it's worth it.

First and foremost, get ADB working. Beyond the scope of this post, go to Google for more info on doing this. Make sure, though, that your phone's debugging is enabled (Menu > Settings > Applications > Development).

Once ADB works, install the software above in the appropriate places. For com2tcp, put its executable file somewhere in the system path. I used c:\windows\system32 for it (and for ADB, come to think of it) but many people might balk at this, as though it's some holy ground on which lowly mortal files shalt not tread. Whatever. Find a hole it'll fit in and make sure it's in your system path.

After installing ALL of the above software, do this, in this order:

1) Connect the phone to the laptop via USB.

ON THE LAPTOP

2) Open com0com from your start menu.

3) Either remember these names for the com ports (at the top of the com0com window) OR name them more memorably. I'll use COM1 and COM2, but ONLY BECAUSE MY LAPTOP DOESN'T ALREADY HAVE THESE TWO PORTS. You can call them PORT1 and PORT2 if you want, or CHUNKY1 and CHEWY234 but I used COM1 and COM2. So, the rest of these instructions will be the way I did it -- you'll have to adjust them accordingly, and if you're not smart enough to figure out how to do so or what I mean by that, then I can't help you. After naming them, hit APPLY.

3b) On your first time running com0com, it'll want you to install new devices, twice. LET IT. Just let it do the automatic thing and you'll be fine.

4) Open the command prompt (Windowkey-R, "cmd", ENTER) (or Start, Programs, Accessories, Command Prompt).

5) In the command prompt, type in:

adb forward tcp:50000 tcp:50000

and hit enter. This creates the forwarding of the phone's internal communications to the USB (I think). Assuming there are no errors (if there are, you either did something wrong or you did something wrong (like getting ADB working)) then type in the following

com2tcp --telnet \\.\COM1 127.0.0.1 50000

and hit enter. This uses the above-created forward of comms and attaches it to the virtual COM port made with com0com in step 3. This time, assuming there are no errors, you should see some diagnostic output.

ON THE PHONE

6) Open ShareGPS.

6b) In ShareGPS, Menu > Settings, select Use USB and deselect Use Bluetooth. The Format is irrelevant to what we're doing, and Create NMEA is not needed for the HTC Dream hardware as the output already is in NMEA format AFAICT. Back out of the settings screen.

7) Tether your Internet connection. OPTIONAL: If your laptop already has Internet access somehow else, you can ignore this step.

8) Open and connect your mapping application on the laptop. YMMV, depends on your software, I can't help you here. In Google Earth, go to Tools, GPS, and click the REALTIME tab. Select NMEA, not Garmin. Select other options as appropriate (like auto follow). Hit start. You should, if it works, see diagnostic output in your command prompt window as well as a connection message on the phone in ShareGPS. In Google Earth, YMMV, but I at first saw no icon, and second I saw a little blue dot. Problem is, in GE, it quickly disconnects and reconnects. You might have better luck with GooPs Free.

If you use GooPs Free, it might not pop up in front. Look down in your system tray, and you'll find the GooPs icon. Right-click it, and select "Open GooPs". you'll be presented a small window. Click options. For the COM port, use one of the two that you made with com0com (if one doesn't work, try the other). Default rate worked for me, Hardware flow control. Autoconnect, Autoscan are set for me. The rest of the options should be pretty self-explanatory. If not, I can't help you (it's midnight here and I'm oh so tired right now) (but I REALLY wanted to get this posted to help anyone else). IF everything works, you'll have an obnoxiously large 3D arrowhead right where you are in Google Earth. If not, you'll have to troubleshoot the errors.

-----------------------------------------

Feel free to ask questions in reply, as I'll of course subscribe to this thread, but understand that I can't answer all questions as I barely understand enough to get this working myself.

ALSO, KNOW THIS: YOUR PHONE WILL BECOME LESS STABLE. I noticed a significant increase of unprompted reboots of my phone after futzing with these programs. Sometimes it lasted a few minutes, but usually it goes for hours. Further, they don't seem to be an issue until I start GPS tethering, so maybe it's not so bad.

You CANNOT use GPS Tether and USB Internet Tether at the same time. If you need to tether your phone's Internet, install WiFi Tether for Root Users (link above) and set it up accordingly. You should be able to launch WiFi tether at any time, but I would recommend doing it before forwarding the ADB GPS ports.

I do sincerely hope this helps someone, and if not, hopefully it will save time and not waste it.

Best Regards to All

Edits below:

WARNING: IF YOU PERFORM THIS HACK, AND THAT'S WHAT IT IS, YOU **WILL** SEE SUCH A HUGE DRAIN ON YOUR G1'S WIMPY LITTLE BATTERY THAT EVEN WITH IT PLUGGED IN AND "CHARGING" YOU WILL STILL HAVE A DRAIN UPWARD OF 35 PERCENT PER HOUR. ALSO, YOUR PHONE WILL GET HOT. NOT WARM. HOT. THINK ABOUT IT: YOU'RE CHARGING, YOU'RE RUNNING WIFI, AND YOU'RE RUNNING GPS ALL AT THE SAME TIME YOUR CUSTOM HACK ROM IS RUNNING YOUR CPU AT ITS MAXIMUM SPEED.

YOU HAVE BEEN WARNED.