Android – Preserve or delete files created by the application on uninstall

Seems like there have been some developments since 2009 :). From the documentation: If you’re using API Level 8 or greater, use getExternalCacheDir() to open a File that represents the external storage directory where you should save cache files. If the user uninstalls your application, these files will be automatically deleted. However, during the life … Read more

Android backup/restore: how to backup an internal database?

After revisiting my question, I was able to get it to work after looking at how ConnectBot does it. Thanks Kenny and Jeffrey! It’s actually as easy as adding: FileBackupHelper hosts = new FileBackupHelper(this, “../databases/” + HostDatabase.DB_NAME); addHelper(HostDatabase.DB_NAME, hosts); to your BackupAgentHelper. The point I was missing was the fact that you’d have to use … Read more