Question

in an effort to save battery life in Android im considering using HTML5's navigator to get the lat and lg. So i wanted to know does html5 call the phones gps to get the coordinates or it how is it so accurate ?

My goal is to find out if HTML5 gets the coordinates from the server or from the local device. I have read that if its a network location based it can get the location from the router but if there is no network based location available and GPS is available what happens ?

Was it helpful?

Solution

First of all the Geolocation API is not part of HTML5.

Secondly, the API will use whatever is available in attempting to return the position. If the phone has GPS turned on, it will use that, if not, it will use the cell tower it's attached to or the WiFi connection. Basically it will do the best job that it can based on the data available to it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top