getResources().openRawResourceFd(int id) Get the FileDescriptor for the file and use MediaPlayer.setDataSource (FileDescriptor fd) method.
Balwinder Kaur Mobile.Software.Development ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Oct 8, 12:55 am, abhi <[email protected]> wrote: > Hi, > > I have included three MP3 file in the R.raw folder. Now I am able to > get the file name of the MP3 file, but I need to find out the complete > path of the file in order to play the file using MediaPlayer. > > I am using MediaPlayer.setDataSource(String path) to set the path to > the file. When I set the path as just the file name, the MediaPlayer > does not play it. > > Is there any way to get the full path of the MP3 file in resources? Or > else, can I use some other implementation of MediaPlayer.setDataSource > ()? > > Thanks, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

