Geolocation accuracy

If you where to build an app native or with HTML5 would the use of Geolocation get its information from different places? Would the accuracy be different?

Geolocation based on IP addresses isn’t very accurate. It typically gets the Country and State/Provence correct about 90% of the time. Cities are hit or miss, and tend to return the ISP’s address, rather than the user’s.

Geolocation based on GPS coordinates is very accurate, but not all devices support this.

thanks for the quick response. Is it possible to detect via javascript whether a device has GPS?

Sort of. In javascript, you basically just check to see if the geolocation engine can run. If so, you have access to whichever geolocation resources the device has permission to provide.

As for GeoIP, that uses a completely different solution, and isn’t really a part of the build-in geolocation engine build into HTML5.

if (navigator.geolocation) {
    //do geolocation stuff
}else{
    //geolocation not supported. Do something else.
}

You can also do error detection do see why geolocation isn’t available even when it is supported on the device:

maybe slightly off track, you can also eventually incorporate google maps api with the sensor argument as ‘true’

for example
http://maps.googleapis.com/maps/api/directions/xml?origin=ORIGIN&destination=DESTINATION&sensor=true