mediaPlayer.setDataSource(fd) cause IOException: Prepare failed.: status=0x1

by Marco Nelissen » Fri, 07 Aug 2009 01:53:49 GMT


Sponsored Links
 




You need to use the version of setDataSource() that takes a FileDescriptor,
offset, and length.



Because setDataSource() doesn't parse the file, so the player engine is only
finding out that it can't play your apk file after you call prepare().

And why on earth is the same resource happily played one way but not


There is no design flaw. The issue is that you were only using the
FileDescriptor that you obtained from the AssetFileDescriptor that
openRawResource() returns. That file descriptor is for the entire apk file,
whereas you only want to play a specific part of that apk file.

Should I look in the  MediaPlayer.create code to see how they get

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



Other Threads

1. How to run the adb command with the emulator?

Hi,

I try to run the 'adb shell' command with the emulator.
But all I get is 'error: device not found'.  Can you please tell me
how to setup my emulator to work with the 'adb shell' command'?

$ adb shell am instrument
error: device not found

Thank you.

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

2. free android programming book

Hi ,

Is there any free andorid pdf or manual  available ?

Reagrds,
Ashwani

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

3. Wrong resultCode when sending email?

4. Android File System Build Error

5. Video resolution support

6. How to extract an image from a video

7. how to add scroll bar to linearlayout