移除在卸载应用程序时通过手机间隙创建的文件 [英] Removing file created by phone gap on uninstalling app
问题描述
我正在开发一个混合移动应用程序,其中,我必须创建一个文件夹,其中我使用手机间隙存储图像。我有一个新问题。我想在ios和android使用手机应用程序卸载该应用程序时删除该文件夹。
I am developing a hybrid mobile application in which , i have to create a folder inside which i am storing the images using phone gap. I have a new issue .I want to remove that folder when uninstalling that app in ios and android using phone app.
推荐答案
Idan Adar告诉,在程序卸载时无法删除文件。而是如果您可以创建文件夹并将文件存储在应用程序内部存储中。它会自动被删除。所以为了做到这一点,我们有以下步骤。这些步骤来自堆栈溢出链接。
As Idan Adar told ,cannot delete the files at time of uninstalling programmatically. Instead if you can create folder and store the file in the app internal storage. It will automatically gets deleted. So for doing this we have the following steps. This steps were taken from the stack overflow link.
在Android上:按照官方API文档
On Android: as per official API docs
将以下两行中的一行添加到config.xml中:
add one of these two lines to config.xml:
<preference name="AndroidPersistentFileLocation" value="Internal" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
<
Without this line, the File plugin will use Compatibility as the default. If a preference tag is present, and is not one of these values, the application will not start.
在iOS上
将以下两行添加到config.xml中:
add one of these two lines to config.xml:
<preference name="iosPersistentFileLocation" value="Library" />
<preference name="iosPersistentFileLocation" value="Compatibility" />
<如果存在首选标记,并且不是这些值之一,则应用程序将无法启动。
Without this line, the File plugin will use Compatibility as the default. If a preference tag is present, and is not one of these values, the application will not start.
这篇关于移除在卸载应用程序时通过手机间隙创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!