I used HTML5
code for getting coordinates on Android (HTC desire s) with GPS enabled and iPhone (3gs). But the latitude and longitude are different on both devices at same place, why?.
Difference was around 20
meter. Why the difference is so much?
Edit
Coordinates only differ on cross platform(iPhone-Android), these are almost same on same platform(Android-Android).
Best Answer
I think the difference is likely due to the way that the Android phone with a GPS, and the iPhone using 3GS, are determining their location.
I am not sure about all Android phones, but it is likely that they are all using similar GPS for location purposes. This could be verified if you provided the similar models that you tested with. Anyway, the point is that phones that use true GPS are determining their location by decoding and triangulating based on radio signals Global Positioning Satellites. This is accomplished with a chip located on the phone itself, and using a minimum of 4 satellites.
The iPhone, on the other hand, uses a combination of Assisted GPS, and GLONASS, which is the Russian Global Navigation Satellite System. Assisted, or A-GPS uses network resources to augment the signal location information received from the GPS. This augmentation takes two major forms, which may significantly affect the derived location (from the Wikipedia article referenced above):
The differences are not likely a factor of the two satellite systems. The more likely reason has to do with the Android phone directly deriving the location from the satellite signals, , where the iPhone is using the satellite signals as a basis, but uses additional information to influence the processing of the signal and deriving the location. The accuracy of the additional information thus influences the derived position.
If the iPhone had a full GPS chip on board that was performing the GPS signal processing, the locations would likely be much closer, assuming, as @U2ros mentioned, that the phones were held in the same location and the readings were taken at the same time.
The last factor to consider is the Positional Accuracy that the respective phones are capable of determining with their GPS implementation. Assuming that each phone has an accuracy of 10 Meters, meaning that for a given point, the location could be determined to be anywhere in a circle of radius 10 meters around that point. You could thus end up with each phone determining the location to be on opposite sides of that 10 meter circle, thus being 20 meters apart.
Example: