Q:

How to use GPS Service in android

I'm working on Android project that related to GPS I still new to android so I don't know a lot about it.
My project is an app where it calculates the distance between user location and a specified other location so if the distance is less than (X) say 1KM the app will send a notification to the user.[[I know how to calculate the distance between two
locations]].
My problem is: how can I do this even if the user didn't open the app (I mean if there's anyway that I can make the app calculates the distance in the background while the app is closed).so I want the GPS feature works in the background.
Thanks in Advance. 

A:

You can use a service for background process.
For your question for getting location, you should try these links:
Best way to get user GPS location in background in Android
Get GPS location via a service in Android

