Skip to content Skip to sidebar Skip to footer

Can I Move A File In An Asset Folder To An Asset Sub-folder?

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 -

Solution 1:

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

Solution 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.

Solution 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...

Post a Comment for "Can I Move A File In An Asset Folder To An Asset Sub-folder?"