Version 2 of the Cell Phone Tracker Now Available!
Download source code for this article
Support Forum
View video tutorial explaining how to setup phone app in Netbeans 6.0
Introduction
Thanks for trying out GPS Tracker. This project allows someone to track a GPS enabled cell phone using Google maps. For this project I used a Motorola i355 cell phone on the Sprint/Nextel network. You need to have a data plan so that you can make updates to your website from the cellphone. Please read the ReadMe.txt file in the download for installation instructions. I hope you enjoy the project. If you have any questions, feel free ask them in the forum.
There are two projects available. The first project is built with .NET and Microsoft SQL Server. The second project is built with PHP and MySQL. If you have any suggestions, please feel free to let me know. Both projects use java (J2ME) on the phone.
Please note that while it's ok to track your cell phone with Google maps, it is against their Terms of Service to track vehicles with their free plan. In order to be able to track vehicles, you must purchase their Google Maps for Enterprise.
How It Works
None of the code for this project is very difficult, but it does span a number of tiers and languages which may be unfamiliar to some. Figure 1 shows the data flow from phone to Google map.
Fig. 1 Data Flow

Phone
Let's start with the code on the phone. This app is written in java using Java 2 Micro Edition (Java Me). Java is very similar to C#. As you look through the code, the only thing that might confuse a C# coder is the vector. A java vector is pretty much a C# ArrayList, a dynamic array. There are 2 classes in the app, LBSMidlet7 and Qworker. A midlet is an app that runs on cell phones. Take a look at the class definition. It extends the MIDlet class and implements a LocationListener interface. That means that we need to put all the method definitions of that interface into our class. We'll get to that in a bit, right now let's look at the constructor.
Fig. 2 Phone Classes
 |