I need your help, may be this question is very easy for you. I have a file in /res/raw folder. For example, it's id is R.raw.myFile. I need to get "File" object. Such as i can do with file on sdcard
File file = new File("/sdcard/myFolder/myFile");
How I can do this?
By the way, sorry for my english if there are some mistakes.
I need "File" object. Not stream.
The raw folder is created inside the res folder: main/res/raw.
Open the Camera app. Tap the settings gear in the top left corner. Go to Format and advanced options. Turn the RAW copies toggle on.
Put files to your package's res/raw folder. Use the getResources() method from the Activity class to return a Resources object. Use its openRawResource() method to open the file contained in the res/raw folder.
Use this
InputStream inputStream = getResources().openRawResource(R.raw.filename);
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