First, the basic knowledge
In the process of running the application, if you need to save data to the phone, the data is usually saved in SDcard.
Most applications create a folder directly under the root of the sdcard, and then save the data in that folder.
So when the app is uninstalled, The data remains in the SDcard, leaving behind the junk data.
If you want your app to be uninstalled, The data associated with the app is also erased, what should I do?
Context.getexternalfile The SDir () method can get to sdcard/android/data/your app's package name/files/directory, usually put some long time to save the data
The Context.getexternalcachedir () method allows you to get to sdcard/android/data/your app package name/cache/directory, typically storing temporary cache data
If you use the above method, when your app is uninstalled by the user, sdcard/android/data/your app's package name/All files in this directory will be deleted, leaving no spam messages.
And the "Clear data" and "clear cache" options in the above two directories corresponding to the application details of settings--
If you want to save the downloaded content, do not put it in the above directory
Ii. Examples of pictures
Android/data Directory android/data/App package name
Android Cache directory Context.getexternalfilesdir () and Context.getexternalcachedir () methods