Android - Remove data from SDCard
My application use the SDCard to store data (about 100 Mb of stuff). I would like to delete these file when the application is deleted through the application manager and offer a way to clear the data from there (like the Google Apps does). Any id开发者_Python百科eas ?
Quote From http://developer.android.com/guide/topics/data/data-storage.html
Accessing files on external storage
If you're using API Level 8 or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you should save your files. ... If the user uninstalls your application, this directory and all its contents will be deleted.
From my understanding this will create a file on the sd card which has a scope (like a directory of your applications package namespace) and the phone will delete the directory when you uninstall the app. I assume this is how Google apps achieves this function.
精彩评论