My application allows users to create and modify files. I would like them to be able to send a file as an email attachment. So, I need to first create and write to a temporary file, which I then attach to the email. Unfortunately, based on the lone response to the below question, it seems there is no good way to know that the email application is done with the temporary file.
Android: problem sending email with attachment from my application
Because I can't receive any notification that the email is done with the file, my rules for deleting temporary files are pretty bad. They are something like "check for temp files onPause and onCreate; delete anything over 5 minutes old".
Because my rules are so ugly, I'm particularly concerned where I should write the files. I can not write them to the internal cache directory because their size can greatly exceed 1mb. Is it reasonable to create a folder devices' sdcard: "/sdcard/myapp_tmp"? What is the common practice for this situation?