This is a working example for the gps. The issue being that it works only on the emulator, it does not show the location on the phone.