not able to play file when set data source to the sdcard file

by Honest » Mon, 13 Apr 2009 17:55:06 GMT


Sponsored Links
 Hello,
I am trying to play file which is stored in SDCARD in emulator. I have
Linux O/S. So i need to provide command in run configuration.

I am providing following parameter.

-sdcard /usr/android/sdcard/mysdcard.iso -audio oss
[i]

The following is my code to play file.

try
{
mMediaPlayer.setDataSource("/sdcard/test_cbr.mp3");
mMediaPlayer.prepare(); // Giving error.
mMediaPlayer.start();

}
catch(Exception e)
{
System.out.println("exception="+e.toString());
}



It is giving me error when i am calling prepare(). Cans some one tell
me what could be wrong in it ? Am i using wrong separator in run
configuration ?


--~--~---------~--~----~------------~-------~--~----~



not able to play file when set data source to the sdcard file

by Nithin » Mon, 13 Apr 2009 20:10:22 GMT


 Hi,


Normally, this error occurs, when you didnt put sdcard in emulator.
Launch emulator with SDCard. You put the .mp3 file in "data/misc"
folder and try, if its working then the problem is launch emulator
with SDCard only..

Thanks
Nithin
nithinwarier.blogspot.com
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


not able to play file when set data source to the sdcard file

by Honest » Mon, 13 Apr 2009 21:30:51 GMT


 Thanks nitin for your quick reply. From you suggestion i solved my
problem but i am not geting why it is not able to access file from
sdcard even if the file is available there so there should be
something wrong in it. I also added the command line paramiter which i
am passing so please take a look and let me know if you found
something wrong in it.



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Any way to check calendar to see if user is Busy now?

I want to check the onboard calendar on the phone (the one thats
synced with Google Calendar), to see if the calendar shows the user as
Busy at the moment. Any way to do this? I'd prefer to avoid making a
call to the Google calendar web service, plus I dont know if that will
require my app to have access to the user's Google account
credentials.
Thanks
Jay





--~--~---------~--~----~------------~-------~--~----~

2. shutting down the display screen

I would like to make the phone appear to be powered down. In essence
shut the keypad off as well as the display. I've looked at Lock wake
activities, but was wondering if there was a way to put this device in
sleep mode, but keep threads running in the background.

ideas appreciated.
--~--~---------~--~----~------------~-------~--~----~

3. Screen Lock

4. why there are two DRM implementation in Android

5. Is GSM Modem multiplexer necessary to use GPRS in Android ?

6. Android Junit test framework

7. G1 camera preview issues uncovered