My question is: is it possible to get the absolute path of a resource (in a subdirectory of the res/ folder) in Android?
Most of the answers I see to this question on google suggest getting a file descriptor, implying that this is not possible.
Is it?
EDIT: The reason I want to do this is because I'm writing classes that accept a path to media and play it. Testing would be much easier if I could pass the absolute path of a resource.
Use URI Paths instead of "absolute" path, see this post
Or use openRawResource(R.id) to open an inputStream, and use it the same way you would use a FileInputStream (readonly)
In general, NO. As it was repeated several times here, you need to access them through the resources.
That said, there are ways you can work around that:
/data/data/yourapp/
or/tmp/
In any case, you would test against a solution that will most probably not work in most of the devices. I suggest you to follow the directions from the dev guide: http://developer.android.com/guide/topics/data/data-storage.html
Not possible. The resource folder you see is compiled into the apk, and it may not even store as it is. (e.g. those layout xml files are no longer xml files once it is compiled)
Two possible solution/work-around for your situation: