Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7768687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:58:40+00:00 2026-06-01T15:58:40+00:00

I’m using the MediaPlayer to stream MP3 files via http and it works great

  • 0

I’m using the MediaPlayer to stream MP3 files via http and it works great in the emulator, here’s the heart of the code I’m using (targeting sdk version 8):

// play selected track      
    if(mediaplayer.isPlaying()){
        mediaplayer.reset();
    }

    try {
        mediaplayer.setDataSource(selectedTrack.url);
        mediaplayer.prepare();
    } catch (IllegalArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IllegalStateException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    mediaplayer.start();

However, when I try to debug it on a device (Motorola Droid RAZR running 2.3.5), I get the error below:

03-23 08:51:02.873: E/MediaPlayer(9442): error (1, -1004)
03-23 08:51:02.873: W/System.err(9442): java.io.IOException: Prepare failed.: status=0x1

Here’s the full stack trace for the run:

03-23 08:50:44.842: W/ActivityThread(9442): Application com.murfie.murfdroid is waiting for the debugger on port 8100...
03-23 08:50:44.850: I/System.out(9442): Sending WAIT chunk
03-23 08:50:44.858: I/dalvikvm(9442): Debugger is active
03-23 08:50:45.045: I/System.out(9442): Debugger has connected
03-23 08:50:45.045: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:45.248: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:45.451: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:45.654: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:45.850: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:46.053: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:46.256: I/System.out(9442): waiting for debugger to settle...
03-23 08:50:46.451: I/System.out(9442): debugger has settled (1490)
03-23 08:50:46.865: D/dalvikvm(9442): GC_EXTERNAL_ALLOC freed 52K, 44% free 3066K/5379K, external 2756K/2773K, paused 28ms
03-23 08:50:52.803: D/dalvikvm(9442): GC_EXTERNAL_ALLOC freed 83K, 42% free 3194K/5447K, external 3453K/3470K, paused 26ms
03-23 08:50:55.912: D/dalvikvm(9442): GC_EXTERNAL_ALLOC freed 21K, 42% free 3208K/5447K, external 4323K/4499K, paused 36ms
03-23 08:50:55.975: D/dalvikvm(9442): GC_EXTERNAL_ALLOC freed 3K, 42% free 3205K/5447K, external 5259K/5399K, paused 25ms
03-23 08:51:02.873: E/MediaPlayer(9442): error (1, -1004)
03-23 08:51:02.873: W/System.err(9442): java.io.IOException: Prepare failed.: status=0x1
03-23 08:51:02.904: W/System.err(9442):     at android.media.MediaPlayer.prepare(Native Method)
03-23 08:51:02.912: W/System.err(9442):     at com.murfie.murfdroid.Murfdroid.playSelectedTrack(Murfdroid.java:162)
03-23 08:51:02.912: W/System.err(9442):     at com.murfie.murfdroid.Murfdroid.access$3(Murfdroid.java:151)
03-23 08:51:02.912: W/System.err(9442):     at com.murfie.murfdroid.Murfdroid$4.onClick(Murfdroid.java:130)
03-23 08:51:02.920: W/System.err(9442):     at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:932)
03-23 08:51:02.920: W/System.err(9442):     at android.widget.AdapterView.performItemClick(AdapterView.java:290)
03-23 08:51:02.928: W/System.err(9442):     at android.widget.ListView.performItemClick(ListView.java:3602)
03-23 08:51:02.928: W/System.err(9442):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1838)
03-23 08:51:02.928: W/System.err(9442):     at android.os.Handler.handleCallback(Handler.java:587)
03-23 08:51:02.936: W/System.err(9442):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-23 08:51:02.936: W/System.err(9442):     at android.os.Looper.loop(Looper.java:130)
03-23 08:51:02.936: W/System.err(9442):     at android.app.ActivityThread.main(ActivityThread.java:3859)
03-23 08:51:02.944: W/System.err(9442):     at java.lang.reflect.Method.invokeNative(Native Method)
03-23 08:51:02.944: W/System.err(9442):     at java.lang.reflect.Method.invoke(Method.java:507)
03-23 08:51:02.944: W/System.err(9442):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)
03-23 08:51:02.944: W/System.err(9442):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)
03-23 08:51:02.951: W/System.err(9442):     at dalvik.system.NativeStart.main(Native Method)
03-23 08:51:02.951: E/MediaPlayer(9442): start called in state 0
03-23 08:51:02.951: E/MediaPlayer(9442): error (-38, 0)
03-23 08:51:02.975: E/MediaPlayer(9442): Error (-38,0)

I’m new to Android development so I may be missing something obvious here, but my guess is that it may be some sort of platform-specific issue based on other bits of info I’ve found googling around; if targeting a higher SDK version would change that, that may be a viable option but I’d prefer to make the app compatible with as many Android devices as possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:58:42+00:00Added an answer on June 1, 2026 at 3:58 pm

    Ok, here’s the solution I arrived at:

    After reading this thread:

    http://code.google.com/p/android/issues/detail?id=17553

    It became obvious that what we were trying to do would never work on pre 4.x Android and that Google had no intention of fixing it. Given this, made two changes to my app to get it working:

    1. Implemented the StreamProxy (http://code.google.com/p/npr-android-app/source/search?q=streamproxy&origq=streamproxy&btnG=Search+Trunk) approach used to make mp3 streaming compatible with pre-2.2 Android systems
    2. Modified the API to use non-SSL URLs for media file sources

    With these two changes the app now works on the Droid RAZR, Kindle Fire and any other piece of Android hardware I can come up with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.