Had a similiar problem, you have two options.
Option 1:
Add this to process Globals:
Dim PWS as PhoneWakeState 'Variable for Phonewakestate
Add this somewhere into the code, preferred at ActivityStart:
PWS.KeepAlive (False) 'Enabling Wakelock with dimmed display
Add this to Activity_Pause:
PWS.ReleaseKeepAlive 'Disabling Wakelock when APP finishes
Option 2:
Try it with a service in background, preferred StartServiceAt. This will run independent from your app.
I tryed in my program the first option, but it will drain your phone's batterys visibly, simply because of the dimmed (but still lighted!) display. GPS-hardware is giving an additional huge load to powerconsumption...
I am a newbie too, I tryed to implement a service for that kind of GPS-thing since days. I believe, I figured out now how to do. So it's your choice. Option 1 is ok, depending on your phones batterystate. But keep in mind, that every phonecall you get, every case interrupting your program in foreground will pause it (stop it, and give the system the chance for killing the APP). The second option runs as long as you don't stop it or the system will kill the service.
Cheers from Berlin
BV