Android: Delete app associated files from external storage on Uninstall?

后端 未结 4 964
情话喂你
情话喂你 2021-01-02 08:15

It\'d be convenient if an application I\'m writing stored some files to external storage permanently (so they persist after the application has been exited[destroyed]), but

4条回答
  •  醉话见心
    2021-01-02 08:39

    actually it is possible .

    android will automatically remove files of the app in the external storage , but the files must be inside a specific path of the app :

    "...../Android/data/APP_PACKAGE_NAME/"

    where APP_PACKAGE_NAME is the application's package name. another path that is automatically being emptied is :

    "...../Android/obb/APP_PACKAGE_NAME/" where APP_PACKAGE_NAME is the application's package name.

    the data is for anything you wish. the obb folder is for huge files that are downloaded using the play-store and the apk extension library . you are not supposed to create files there .

提交回复
热议问题