title: Saving Android application data on app exit
body: <p>It seems that there is a large amount of information about saving <strong>Activity</strong> state, but I have been unable to locate much on finding <strong>Application</strong> state.</p>
  
  <p>I am looking for some design ideas to solve a problem I have run into. I am developing a game that has a fairly large data model (1-2 MBytes). This model exists outside of any Activity, in fact there are numerous activities that all interact with it. These activities are transient, coming and going all the time.</p>
  
  <p>I currently keep a pointer to the data model in my application and all of the activities access the data model through it. I need to save that data model in the event that my application is being killed, but it is far too slow to save it every time an activity hits onPause, which happens very frequently as activities come and go. </p>
  
  <p>What I need is a way to determine that my application (and along with it my data model) are being destroyed. I have searched extensively for this method or callback and have come up empty.</p>
  
  <p>I would appreciate any suggestions.</p>