开发者

create a sub directory in asset directory on run time in android

Can anybody tell me how to create a sub folder in asset folder at run tim开发者_运维技巧e and copy the files from res folder to my assets sub folder?


It is not possible to do this in runtime.


As far as I know this is not possible because of security restrictions. Your asset folder is merged with all your other files into one .apk package. That's your app ready for deployment.

When installing the package the user is asked if he's granting a set of privileges to the app such as accessing private data (text message, contacts) as well as technical stuff like writing on the external storage (SD card).

At this moment you can't modify your asset folder any more because it became a part of the app and application's code and resources may not be change after installation.

See also Android's page about security and permissions.

PS: I'm quite new to Android and I just explain it the way I understood it. In case I'm just talking bullshit feel free to edit me :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜