Android - delete files on SD card on uninstall

后端 未结 2 1229
清酒与你
清酒与你 2021-02-02 14:54

My app downloads some multi-media files from a server when it\'s installed. I do this to save space on the size of the app. However, the drawback of this approach is that when t

2条回答
  •  囚心锁ツ
    2021-02-02 15:31

    from http://developer.android.com/guide/topics/data/data-storage.html#filesExternal "If you're using API Level 7 or lower, use getExternalStorageDirectory(), to open a File representing the root of the external storage. You should then write your data in the following directory:

    /Android/data//files/
    

    The is your Java-style package name, such as "com.example.android.app". If the user's device is running API Level 8 or greater and they uninstall your application, this directory and all its contents will be deleted."

提交回复
热议问题