I want to open a file from the res / raw / folder. I am absolutely sure that the file exists. To open the file, I tried
File ddd = new File("res/raw/example.png");
Team
ddd.exists();
gives a FALSE . Therefore, this method does not work.
Attempt
MyContext.getAssets().open("example.png");
ends in an exception with getMessage () "null".
Just using
R.raw.example
impossible because the file name is known only at run time as a string.
Why is it so difficult to access the file in the / res / raw / folder?
android file-io resources
Bernd Apr 09 '13 at 21:24 2013-04-09 21:24
source share