Android 自动创建和删除资产文件夹中的文件
可能重复:Android 自动创建和删除资产文件夹中的文件,android,android-file,android-assets,Android,Android File,Android Assets,可能重复: 是否可以在应用程序运行时在资产文件夹中创建文件,并在应用程序停止时删除同一文件 对于资产,您仅具有读取文件权限。因此,您无法在“资源”文件夹中创建/删除文件。以下是应用于“资产”文件夹的限制 1) Only Read Permission available for this folder. 2) File size for placing inside the assets limit to 10 MB.If you want to place then
是否可以在应用程序运行时在资产文件夹中创建文件,并在应用程序停止时删除同一文件 对于资产,您仅具有读取文件权限。因此,您无法在“资源”文件夹中创建/删除文件。以下是应用于“资产”文件夹的限制
1) Only Read Permission available for this folder.
2) File size for placing inside the assets limit to 10 MB.If you want to place
then the larger file should be placed as chunk.
3) You can use this folder, for placing files like database file, font file etc...
别跟它打架。使用资产文件夹处理文件不是一种正确的方法。
您可以使用SD卡,它是创建和删除文件的合适位置
您可以使用标准方法通过应用程序将文件放置在SD卡中
Environment.getExternalStoragePublicDirectory("filetype");
apk是只读的,并且资产/文件夹在运行时不可修改,这听起来像是您正在寻找的东西。检查这个