Many modern mobile phones (google nexus one etc.) have some kind of built in location service. when i go to a some website (eg. google.com) that website asks if I\'m willing to
Application use the native API on the platform to get location. In the case of Android, native apps are usually built using Java and use the Android SDK. Apple iPhone/IApd apps are written in Objective-C against the iPhone SDK.
You can write native apps using web skills (i.e. Javascript, CSS and HTML) using tools, like PhoneGap, that give you access to the native functions of the phone.