Sunday, January 27, 2013

Real-Time GPS Tracking of my Android Phone

I made a website to track the location of my Android Phone real time.
Aww it was a pleasant project. But of course I cannot show the url to this for privacy reasons ;)





This is the step I took..
1 Download Android SDK. This includes IDE (eclipse with Android SDK plugin installed).  So you can create an android app project right away. Basic Android App dev tutorial
2. Give permission requests in the manifest file (internet and gps device), and follow this tutorial to get the source code to get the access to GPS device.
3. In the main java code, do http get request to send the latitude and longitude of the location to the django loaded in amazon web services. Such request is made every 5 seconds within android view.
4. Using USB debugging mode, upload and install the app.
5. Have a Django views.py to save the location info into a text file (LOL).
6. On the webpage, use JQuery to send repetitive HTTP GET requests (every 3 seconds using setInterval() method. There is no such thing as sleep() method to put in while loop) to get current location. 
7. Use Javascript to do real-time update of the location of marker using Google maps API.
Of course the API key registration needs to be done.

Here goes the source code

3 comments: