Click here to Skip to main content
15,947,389 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I currently have a set of media files in the raw folder of the android project that are loaded quickly and played on button clicked. I need to add more variations of these files and categorize them into folders, but apparently the raw folder does not support folders. Would I be able to quickly load these files from the assets folder and play them on button click? If so, how?
Posted

1 solution

Yes, indeed.
‘Assets’ folder will be distributed along with the APK, which contains all the raw files you need for application, such as: text files (.txt), non-Android XML files (.xml), Audio files (.wav, .mp3, .mid)…; those cannot be put into ‘res‘ folder as usual.

See the documentation[^] in developer.android.com

See the examples for accessing a file which is under assets folder.
http://www.javacodegeeks.com/2012/02/android-read-file-from-assets.html[^]
http://stackoverflow.com/questions/12387637/how-to-access-file-under-assets-folder-in-android[^]

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900