I use the following code to create some temp files, and wrapped tem as inputsteam to send to client side.
I understand that the temp files can be deleted automatically b
call the deleteOnExit() method!
Or
call the delete() method in the onStop() of your activity.
onStop()
Edit:
It might be better if you called delete() in onDestroy() to insure that your code works even if app is destroyed by system.
onDestroy()