title: Android: When a service is killed, how can we persist the service state for later restoration?
body: <p>We have created an app that is essentially a timer/stopwatch with some decked out features.  We defined a service that ticks the clock and alerts listeners (activities, etc.) who are subscribed to certain timer events.  </p>
  
  <p>We would like to be able to save the state of the timer/stopwatch (elapsed seconds, time until next event, user-provided config etc.) whenever android kills our service (for memory recollection), and then restore the state of the service when the app is restored by the user.  <strong>For us, this means possibly preserving and restoring objects and their state.</strong>  We have lots of composition in our service.  Basically, our service is composed of all our timer models, of which die when the service dies.  </p>
  
  <p>What strategies are there to persist the state of the service?  PreferencesManager probably isn't robust enough for our purposes, though it might be.  Can we rely on the Service onDestroy()  method to save state (say in SQLite)?  If android decides to kill our process, is it even guaranteed that the service onDestroy() will be called?  </p>
  
  <p>Thank you!</p>