I'm in the process of finishing up an app. One of the problems I'm encountering is removing the data from the app upon uninstall. My app copies files from the obb expansion file into a directory in the external storage. As such, when the app is uninstalled, it remains, and the obb file gets removed. I'm sure theres a better approach to this.
The files in questions are several hundred mb in video files. I've read various ways to do it such as activity.getdir, but I'm not sure that would be the most efficient way for my scenario.
Thanks!
You should use getExternalCacheDir ()
method instead of Environment.getExternalStorageDirectory()
, doing so : you'll store your files within the cache directory which is somewhere on the External Storage.
When you uninstall your app the files are being automatically removed by Android.
Read this : getExternalCacheDir ().