Time: March 18, 2016 13:35:54
The same point: Files in two folders will not be compiled into binary files, will be left intact in the APK.
Different points:
- Files under asset are not mapped to r files, and the files under raw are mapped to r files.
- Because raw files can be mapped to r files, you can use the R.raw.xxx method to refer to resources.
- There can be a directory structure under asset, and no directory structure under RAW.
Since Raw is a subfolder of Resources (res), Android would automatically generate anID
For any file located inside it. ThisID
Is and then stored aR class
that would act as a reference to a file, meaning it can is easily accessed from the other Android classes and methods and Even in Android XML files. The Using the automatically generated ID is the fastest-to has access to a file in Android.
- the Assets folder is An Directory. The since You'll need to get a handle to it based on a String . However some operations is more easily do by placing files in this folder, like copying a database file to the system ' s Memory. There ' s no (easy)-to-Create an Android XML reference to files inside the Assets folder.
Source: http://stackoverflow.com/questions/9563373/ The-reason-for-assets-and-raw-resources-in-android
From for notes (Wiz)
The difference between raw and asset in Android