I've been fiddling around with this for quite some time. I can't work out why my file /res/raw/video.mp4 can't be found by my Android app. I am on API 15 and the phone is up to date with v4.0.3.
The test code currently looks like this:
String file = "android.resource://" + getPackageName() + "/" + R.raw.movie;
File f = new File(file);
message = f.exists() ? "file exists" : "file missing";
All combinations I have tried so far results in the message string being returned as "file missing". What is the correct way to access a file from the resources? Tried the obvious ones "/res/raw/video.mp4" etc too but all failed.