views:

34

answers:

1

Is it possible to set up a localhost server on Android so that a browser window can access the device's GPS coordinates?

I'd like to be able to access the GPS coordinates in Javascript inside a browser window.

Now I could simply send the GPS coords to the server and read from within the browser window by reading off the server, but I was wondering if there was any way to send the GPS coordinates from the device straight into the browser window without having to go through a remote server?

It would be really great to be able to access the GPS coordinates directly from http://10.0.2.2:9999

Many thanks in advance,

+1  A: 

Can't Javascript already read current location via navigator.geolocation or something like that? This article seems to cover a lot of ground here...

Reuben Scratton
My understanding is that Google gears doesn't work on 2.x devices. I'd prefer just to be able to read the coordinates off a localhost on a certain port and was wondering if this was possible? I'd also like to be able to do the same thing for the iPhone.
Eamorr
Not sure I follow you. Navigator.geolocation is supported on Android 1.6+ and iOS 3+. It should do exactly what you need, unless of course I've misunderstood the question... :)
Reuben Scratton
Hey, thanks for the update. I'll look into Navigator.geolocation. I am new to developing iPhone and Android apps. I'm developing a jqtouch web-app and now have the requirement to use GPS coordinates.
Eamorr