Common
1. The files in both directories will be stored intact in the APK package after packaging, and will not be compiled into binary.
Difference:
The files in the 1.res/raw are mapped to the R.java file, and the files under the R.id.filename;assets folder are not mapped to R.java when accessed, and Assetmanager classes are required for access.
2.res/raw can not have a directory structure, and assets can have a directory structure, that is, assets directory can be re-established folder
* Read File resources:
Res/raw:inputstream is = Getresources (). Openrawresource (R.id.filename);
Assets:getassets (). open (FileName);
What files are in the unknown directory, which go to and get the names of these files and copy the files to the target directory? (for the built-in file but do not know the file name, you need to filter out the desired file and then copied to the target directory, recommended built in the assets folder)
1.res/raw directory:
Get the name of all the resource IDs inside the raw inner class of the R.java in the way of reflection, then get the value of the resource ID by name to read the file we want. (This method I have not tried, useful classmates trouble to send a code to see).
2.assets Catalog:
Getassets (). List (""), to get the names of all the folders and files in the assets directory, and then to read the files we want by these names.
Http://stackoverflow.com/questions/5583608/difference-between-res-and-assets-directories
http://blog.csdn.net/zuolongsnail/article/details/6444806