title: How to stop service the service when android app has been closed
body: <p>I am developing a app where I need to updated my values every 15 min.
  For that i am using services.I came across different types of services.
  Like for long running services we use simple service and,
            for interacting for other components we use bind service,
            foreground service. etc....</p>
  
  <p>My situation is like i need to run the service for every 15 min 
  when my app is open and stop the service when my app is closed</p>
  
  <p>I have tried with bind service using 
  <a href="http://www.truiton.com/2014/11/bound-service-example-android/" rel="nofollow">http://www.truiton.com/2014/11/bound-service-example-android/</a>
  but i am unable to do that,I am unable to run the service every 15 min can any one help me.
  Thanks in advance.</p>