Can i move a file in an asset folder to an asset sub-folder?

怎甘沉沦 提交于 2019-12-24 00:33:12

问题


i have a file in the asset folder, and when i press a button in my program i have to move that file in a sub-folder(run-time). Can it be done?

i have to do this: assets/file.txt -> assets/aaa/file.txt


回答1:


No your assets are compiled into your apk file. Consider storing a persistent preference marking whatever you are trying to do instead.




回答2:


No, you can't do it. You can't write anything inside the assets folder programmatically. Better option is to use internal storage. You can use Files Folder in the internal storage. See getFilesDir() in the docs.




回答3:


Reason: Once you have an .apk file it is read only, so you can't add, delete or modify in it,

Alternate: though you can use the sqlite DB for the purpose... where you can save file in hierarchy using blob type and you can modify it through queries...



来源:https://stackoverflow.com/questions/9361288/can-i-move-a-file-in-an-asset-folder-to-an-asset-sub-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!