My application stores some files that are required for it to run in the data directory of the app
/data/data/com.example.myapp/files/filehere.file
When my application is updated from the market, it is important that I clear the files in the data directory, and update them to the latest ones from the new package that has just been downloaded.
My question is, how do I programatically delete the files in the directory in question?
Alternatively, is there an alternative directory that I can store the files in that are persistent across the lifetime of my application version, but will be cleared once an update is installed?
As for your last question, my guess is you’ll have to control that on your upgrade process. f.e., create a directory for each version and manage the files inside when the user upgrades.