Do temporary files get deleted even while the app is running? <h2>Background</h2> <p>On android, you can create temporary files as such (link <a href="http://developer.android.com/guide/topics/data/data-storage.html#InternalCache" rel="nofollow">here</a> and <a href="http://developer.android.com/reference/java/io/File.html#createTempFile%28java.lang.String,%20java.lang.String,%20java.io.File%29" rel="nofollow">here</a> for documentation) :</p> <pre><code>final File temp = File.createTempFile("myFile", ".tmp", context.getCacheDir()); </code></pre> <p>I'm developing an app that uses temporary files and when it's done with them (and on start of the app), it deletes them.</p> <h2>The question</h2> <p>The documentation says :</p> <blockquote> <p>When the device is low on internal storage space, Android may delete these cache files to recover space.</p> </blockquote> <p>Does it mean that files can get deleted even while my app is still running? In which cases would android be allowed to delete the files? </p> <p>In other words , can I assume that as long as I have the app running , android won't delete the files by itself, even if other apps create their own temporary files?</p>