views:

148

answers:

1

I want to learn a user's location from his mobile device by web application.

When user opens the website, with the help of a script we will learn if the device has a gps hardware.And if the device has gps hardware what are the current coordinates?

I'm developing my project using ASP.NET

Is this possible or not?

Thanks.

A: 

Try google for "html geolocation". You will want to use the Geolocation API, which is part of HTML 5, and already supported by many browsers:

http://dev.w3.org/geo/api/spec-source.html

Short example here:

http://apirocks.com/html5/html5.html#slide14

Jakob Kruse
is this supported on mobile devices?
Jack
Support depends on the browser, not the device (it even works on some devices without GPS modules). Mobile Safari and the Android browser both support it.
Jakob Kruse
thakns Jakob. But it uses IP. I want to use GPS hardware on mobile devices.
Jack
Well, you said "web application". If you want to determine users location from code running within a browser then the Geolocation API is the only way to go. How it determines location (and it actually does use the GPS if one exists) should not be your concern.From the Gears implementation details: "The Geolocation API is an abstraction for various location APIs that currently exist on mobile platforms (GPS-based, network/cellid-based)."
Jakob Kruse
You are right. I m asking, how can I turn on the gps chip and receive latitude and longitude information from satellites in the sky.
Jack
Maybe you should create another question then, because that was not what you asked. You would need a native application for that, not a web application. And again, the browser will do this for you if you use the Geolocation API!
Jakob Kruse