本文介绍了移除在卸载应用程序时通过手机间隙创建的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在开发一个混合移动应用程序,其中,我必须创建一个文件夹,其中我使用手机间隙存储图像。我有一个新问题。我想在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. 这篇关于移除在卸载应用程序时通过手机间隙创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 17:27