Android - How To Get Path Of Mp3 Stored In Raw Folder
After searching for solution, I have found from this link that it is possible to retrieve path like: Using Resource Id Syntax : android.resource://[package]/[resource_id] Example :
Solution 1:
Is it possible to get file path by using R.raw.mp3file
No, because it is not a file on the device. It is a file on the hard drive of your development machine. On the device, it is merely an entry in an APK file.
Either:
Do whatever you are trying to do some other way that does not involve a file path, or
Use
openInputStream()
on aResources
object (you can get one from anyContext
viagetResources()
), and use Java I/O to copy the contents of that resource to a local file, such as on internal storage
Post a Comment for "Android - How To Get Path Of Mp3 Stored In Raw Folder"