I go little problem and maybe you know what i can do. I got database and one of the column is RECORD_PATH, in this column i want to store path for my sound and use it on Media Player. Right now I don't know which way is better (sound on SD/ASSETS/RAW). Don't know also how I can tranfer this path to MEDIA PLAYER ? Someone got similar problem like this and solved it on own project ?
Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
Join them; it only takes a minute:
|
You will want to use the built in constants for getting access to the users SD Card. You can get the path for this from the following call:
Don't forget to add the following permission though to your manifest:
So putting all together you can do something similar to this for saving the file:
Then to pass the file to a built in player you can make and call an Intent as follows:
Let me know if you have any questions and I can expand the answer a bit more. Updates: The above is to save a file and then play that file using an inbuilt media player. If the file is already on the SD card and you want to programmatically play the file you can use the following code:
|
|||||||||||||
|