문제

I want to copy file from SD-Card to app's assets folder in android.Please help me to do it programmatically.

도움이 되었습니까?

해결책

Unfortunately, you can´t. The apps assets folder is readable only, so you cant programmatically store (write) your data there.

(Taken from AssetManager Doc):

This class presents a lower-level API that allows you to open and read raw files that have been bundled with the application as a simple stream of bytes.

Also, see Managing Projects | Android Developers :

assets/ This is empty. You can use it to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top