Skip to content

Instantly share code, notes, and snippets.

@codeswimmer
Created April 10, 2011 01:19
Show Gist options
  • Save codeswimmer/911954 to your computer and use it in GitHub Desktop.
Save codeswimmer/911954 to your computer and use it in GitHub Desktop.
Android: How to use access files stored in the assets folder
/* How to use access files stored in the assets folder:
*
* 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().
*
* Notes:
* * AssetManager.list(String path)
* * path:
* * To get a list of the items in the "assets" folder: Empty string ("")
* * Otherwise, the path to the item contain in "assets" (i.e. "midi", "midi/turbo.mid")
*
*/
// TODO: Fill in the details...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment