title: Can we make android.app.Service as lifecycle aware component
body: <p>all I get from the new Android Architecture Components is, if we make the component lifecycle aware then depending on the activity lifecycle the LifecycleObserver will react to the events. That reduces a lot of boilerplate code that we write in onCreate,onStop or onStart etc. activity or fragment lifecycle methods.</p>
  
  <p>Now how to make an <strong>android service</strong> a lifecycle aware? 
  So far I can see is we can create a service that extent android.arch.lifecycle.LifecycleService. However, I can't see any event related to bind and unbind while I am observing.</p>
  
  <p>Code snippets </p>
  
  <pre><code>// MY BOUNDED service
  public class MyService extends LifecycleService 
          implements LocationManager.LocationListener{
  
      private LocationManager mLocationManager;
      @Override
      public void onCreate() {
          super.onCreate();
          mLocationManager = LocationManager.getInstance(this, this);
          mLocationManager.addLocationListener(this);
      }
  
      @Override
      public void onLocationChanged(Location location) {
      }
  
      @Override
      public IBinder onBind(Intent intent) {
          super.onBind(intent);
  
      }
  
      @Override
      public boolean onUnbind(Intent intent) {
      }
      ...
  }
  
  
  public class LocationManager implements LifecycleObserver{
      public interface LocationListener {
          void onLocationChanged(Location location);
      }
      private LocationManager(LifecycleOwner lifecycleOwner, Context context){
          this.lifecycleOwner =lifecycleOwner;
          this.lifecycleOwner.getLifecycle().addObserver(this);
          this.context = context;
      }
  
      public static LocationAccessProcess getInstance(LifecycleOwner lifecycleOwner, Context context) {
          // just accessiong the object using static method not single ton actually, so don't mind for now
          return new LocationAccessProcess(lifecycleOwner, context);
      }
  
  
      @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
      public void startLocationUpdates() {
          // start getting location updates and update listener
      }
  
      @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
      public void stopLocationUpdates() {
          // stop location updates
      }
  }
  </code></pre>
  
  <p>I have few questions here</p>
  
  <ol>
  <li>How i can observer on ON_BIND and ON_UNBIND events. as I would like to reduce my service code as well.</li>
  <li>Am I doing any thing wrong, Can we release use lifecycle arch for services</li>
  </ol>