views:

431

answers:

4

So it looks like mobile phones these days are capable of providing gps data ;)

I'm building a django app with a mobile edition that I want to be location aware.

My question is, how does one access GPS data? Is there a standard, or do you have to custom code for android/iphone/other.

Ideally, I'd imagine it being provided in the HTTP request in the same way you get information such as the IP Address and User Agent.

+2  A: 

There's a really good blog post about this topic, covering a variety of methods @

http://hitching.net/2009/11/10/location-aware-mobile-web-apps-using-google-maps-v3-geolocation/

Koobz
A: 

Server side API will be common for all platforms (just standard HTTP requests).

GPS access is platform depend and typically You will have to write custom code for all platforms. However you can try use http://www.appcelerator.com/ - framework for crating mobile apps using Web based techniques (there is common appi for GPS access).

Maciek Sawicki
A: 

Your code is going to be used on a mobile client, you know it is going to be a specific kind of phone. Yes you do need to code for a specific device as the API for iPhone is not the same as for Android. Android I don't know yet - for iPhone, you need to use Core Location - the CLLocation class is a good place to start reading in the developer docs once you have Xcode open, and the Locations sample code is a nice starting point that shows how to get a series of position fixes. Maybe you can get some kind of fix back from the server but I don't think you'll find it at all accurate - that is to say not incorrect but with a very large circle of uncertainty.

Adam Eberbach
A: 

Don't forget Google Gears which provides access to geolocation and other goodies.

dtmilano