Provides access to an application’s raw asset files. See Accessing Resources for the way most applications will want to retrieve their resource data.
This type of resource allows you to open and read raw files that have been bundled with the application as a simple stream of bytes.
Asset files are located into assets folder:
Project/ src/ application source code assets/ **files and folders to bundle** res/ application resource
Difference with RAW resources¶
Raw files are located into:
res/ raw/ filename.fileextension
The raw file declared above can be accessed through the Res.java file with the constant Res.raw.filename, while an asset does not correspond to an ID as other resources.
The raw folder can benefit from resource variation: alternative raw files can be provided for some specific device configurations.
Asset files are bundled into:
assets/ your_bundle_folder(s)/ your_bundle_file(s)
The organization of folders and files inside the assets folder is free.
Accessing asset in Code¶
InputStream stream = ResManager.openAsset("path_inside_assets_folder");