Saving large amounts of data when onPause is called?
<p>For my app, I have about 15Mb (which can be compressed with some processing power to about 5Mb) of audio+video+image data that I need to save to disk. For instance, I need to save this when user is interrupted with a phone call (because the activity might get killed after this) and when the user leaves the app.</p>

<p>I can save the data to SD card in about 10 seconds if I don't compress it and something like 20 seconds if I do compress it, where I'd like it compressed. <b>What options to I have for saving my data when onPause is called such that I can be sure the data has been saved?</b></p>

<p>From some basic experiments, my activity gets killed if onPause hasn't finished after 5 seconds. Some ideas I've had:</p>

<ol>
<li><p>Starting a new Thread in onPause and saving the data there. This seems to work fine but seems like something I shouldn't be doing.</p></li>
<li><p>Starting a service, copying the data to the service somehow (would this be slow?) and then getting the service to save the data. I think this puts a notification icon at the top of the phone, but I don't think it's awful for a user to see the "Saving data..." task here.</p></li>
<li><p>Can I put the data in a SQL database quickly and then save it later when the user returns to the app?</p></li>
</ol>

<p>(Due to the nature of the app, there really isn't any practical way I can save the data as I go because the user can transform the data in destructive ways with time consuming operations (e.g. 10 seconds for some operations). Even if I stored the original data and a list of the actions performed to recreate the data, the user would have to wait a minute or two when the app is next started up to process this.)</p>
