how to detect gps location

ok… i have searched this on google many-a-time and i cant find the answer. how would I write a script that would constantly find the x and y of the real life device and then apply it to a players x and y.
thanks in advance

GPS data is accessed through the LocationService class. Unity has a basic example of use here.