title: How to use GPS Service in android
body: <p>I'm working on Android project that related to GPS I still new to android so I don't know a lot about it.</p>
  
  <p>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]].</p>
  
  <p>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.</p>
  
  <p>Thanks in Advance. </p>