Why do the app files remain after the uninstall?

3

I was reading about storage on Android, I realized that there is the internal of the app (/ data / data / package / files) and the external one (which needs permission).

On the external, we have public and private (Android / data / package / files).
In private, from external storage, when uninstalling the app all that is deleted, but the internal is not (as it is said in this answer ). Why?

Can not this be getting extra storage space from Android? In which cases use one or the other? And if the user wants it can force these files to be deleted?

    
asked by anonymous 22.02.2018 / 17:16

1 answer

5

I do not think you read documentation because, contrary to what you say , files saved in the internal storage are deleted after uninstalling the app.

The same thing happens in external storage if you use a private storage directory calling getExternalFilesDir () .

If you want files to survive uninstalling from the app you should save them to external storage using getExternalStoragePublicDirectory () to get a public directory.

    
22.02.2018 / 17:42