Access to Original Files
While uncommon, you might need access your original files and directories. If you do, then saving your files in res/ won't work for you,
because the only way to read a resource from res/ is with the resource ID. Instead, you can save your resources in the assets/ directory.
Files saved in the assets/ directory are not given a resource ID, so you can't reference them through the R class or from XML resources. Instead, you can query files in the assets/ directory like a normal file system and read raw data using AssetManager.
However, if all you require is the ability to read raw data (such as a video or audio file), then save the file in the res/raw/ directory and read a stream of bytes using openRawResource().
Partager