How can I get the URL of the raw folder? I do not want to access my asset via id but by path instead.
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.
Create raw folder under res folder. It must be in a supported format (3gp, wmv, mp4 ) and named with lower case, numerics, underscores and dots in its filename likewise:video_file. mp4. VideoView view = (VideoView)findViewById(R.
Uri video = Uri.parse("android.resource://com.cpt.sample/raw/filename");
Using this you can access the file in raw folder, if you want to access the file in asset folder use this URL...
file:///android_asset/filename
Make sure you don't add the extension to the filename. E.g. "/movie" not "/movie.mp4".
This is to find a file named video.mp4
inside raw folder:
String path = "android.resource://" + getPackageName() + "/" + R.raw.video;
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