我想将文件从 SD 卡复制到 android 中应用程序的 Assets 文件夹中。请帮助我以编程方式执行此操作。
最佳答案
不幸的是,你不能。 应用程序 Assets 文件夹是只读的,因此您不能以编程方式在其中存储(写入)您的数据。
(取自 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.
另请参阅 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.
关于Android:以编程方式将文件从 SD 卡复制到应用程序的 Assets 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23080541/