You can use the HTML5 geolocation API in your ArcGIS Server applications to get the location of a mobile device. You can also use the geolocation API to get the location from a standard web application, but this isn't nearly as accurate since it uses the IP address rather than GPS or cell tower triangulation.
This API has built-in security that requires explicit permission from the end user before this functionality can be used. Both mobile and web applications that use geolocation will prompt the user. This prompt will appear similar to the following screenshot:
Once you have the user's permission, using the API to retrieve location data is pretty straightforward.
The Geolocation.getCurrentPosition() method returns the current location of the mobile device. The Geolocation.watchPosition() method continually monitors the device location...