Android的 - 删除上卸载SD卡上的文件 [英] Android - delete files on SD card on uninstall

查看:271
本文介绍了Android的 - 删除上卸载SD卡上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序从服务器下载了一些多媒体文件,它的安装时。我这样做是为了节省应用程序的大小空间。然而,这种方法的缺点是,当该应用被卸载时,它不删除这些文件。我看到报道说,这是可能的,但我似乎无法使它发挥作用。有没有办法做到这一点上卸载,或者我应该只是忘了这件事?

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 the app is uninstalled, it doesn't delete those files. I've seen reports that this is possible, but I can't seem to make it work. Is there a way to do this on uninstall, or should I just forget about it?

请注意,我已经安装在SD卡上默认,以及应用程序,但我不知道是否所有的手机都将自动支持。

Note that I have the app installed on the SD card by default as well, but I'm not sure if all phones will automatically support this.

推荐答案

你能不能下载的文件,并将其写入使用方法,内部空间在这里解释这些应用程序:的内部存储

Could you download the files and write them to the apps internal space using the methods explained here : Internal Storage

写入内部存储器中的文件,当用户卸载应用程序将被自动删除。

Files written to the internal storage are automatically removed when the user uninstalls your application.

这是我读过的Andr​​oid不允许修改卸载过程中,以帮助防止恶意软件。

From what I've read Android does not allow you to modify the uninstall process to help protect against malware.

与Android 2.2开始(API 8级)的应用程序可以安装在SD卡的

Starting with Android 2.2 (API level 8) apps can be installed on the sdcard.

在这里看到更多的信息:安装应用程序到SD卡

See here for more info : Installing to application to sd card

编辑:显然也有一个外部缓存,您可以使用,根据该文档被当用户卸载你的应用程序也被删除:的外部缓存

Edit : apparently there is also an external cache that you can use that, according to the doc gets removed when the user uninstalls your app also : External cache

这篇关于Android的 - 删除上卸载SD卡上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆