I’m going to distribute my app on the Android Market. This app creates some files/directories… does releasing an update delete old files of the older versions?
If not, what is the best method available on Android to replace old files with new files when the upgraded application is launched first time?
On IOS I solved this problem creating an empty file which indicates the version of the application. When the application is upgraded it compares the old version on the disk with the application version and if they’re different, it deletes old data. But I wanted to know if there’s a native method like the ‘onUpgrade’ method of a SQLiteOpenHelper.
Thank you.
No.
This is a fine solution for Android as well, IMHO.
SQLiteOpenHelperdoes almost exactly what you do in iOS for files, except that instead of an empty file, there is a metadata table with the version data.