Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top