the same points as Res/raw and assets:The files in both directories will be stored intact in the APK package after packaging, and will not be compiled into binary.
Assets and Res/raw projects can be placed under a few files less than 1M (version 2.3 previously required, otherwise you will not be able to read the data.) ), these files will be packaged in apk for use by the app. Files in the assets directory will be packaged without any processing, and if your resources are large, such as videos, etc., should be stored separately in the file system.
different points of Res/raw and assets:
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 resource method:
1. Read the file resource under the Res/raw, and get the input stream for write operation in the following way
InputStream is = Getresources (). Openrawresource (R.id.filename);
2. Read the file resource under the assets, and get the input stream for write operation in the following way
Assetmanager am = null; am = Getassets ();
3. Accessing raw resources via URIs
Uri uri = uri.parse ("Android.resource://package_name/raw/sample.png");
Welcome to scan QR Code, follow public account
Asset folders and raw folders in Android