title: Service stops when application is closed
body: <p>I need a service to run in background and calculate every minute distance between two locations. I used Thread in order to execute a method every minute, then I understood that when the application is closed, the service stops too since application and service use the same thread.
  How can i create a simple method that is invoked every 1 minute, in background even when the application is closed?</p>