In J2ME, I've do this like that: getClass().getResourceAsStream("/raw_resources.dat");
But in android, I always get null on this, why?
The raw (res/raw) folder is one of the most important folders and it plays a very important role during the development of android projects in android studio. The raw folder in Android is used to keep mp3, mp4, sfb files, etc. The raw folder is created inside the res folder: main/res/raw.
As you can see in this example, the res/ directory contains all the resources (in subdirectories): an image resource, two layout resources, mipmap/ directories for launcher icons, and a string resource file.
For raw files, you should consider creating a raw folder inside res directory and then call getResources().openRawResource(resourceName)
from your activity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With