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 7749563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:04:38+00:00 2026-06-01T11:04:38+00:00

I am doing a streamed musicplayer for android. I have tried with MediaPlayer mp.setDataSource(http://www.myServerPage.com/songUrl.mp3);

  • 0

I am doing a streamed musicplayer for android.
I have tried with MediaPlayer

mp.setDataSource("http://www.myServerPage.com/songUrl.mp3"); 
mp.prepare(); 
mp.start(); 

and it works but not good.
The prepare state is very slow and often the application is freezing.

I have searched a lot on forums and tutorials and as far as I can see this is the common way of doing it.

Do anyone know is it is another way of opening up a stream to play music from a server or have any good advices, maybe in NDK or by some other inputstream?

Thanks for the help.
/micke

  • 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-01T11:04:39+00:00Added an answer on June 1, 2026 at 11:04 am

    The Media Playback article is pretty clear about how to deal with remote media sources: call prepareAsync() and set a listener to get notified when the source is ready for playing.

    The reason for this is exactly what you’re experiencing:

    (…) the call to prepare() can take a long time to execute, because it
    might involve fetching and decoding media data. So, as is the case
    with any method that may take long to execute, you should never call
    it from your application’s UI thread
    . Doing that will cause the UI
    to hang until the method returns, which is a very bad user experience
    and can cause an ANR (Application Not Responding) error.

    I suggest you go over the mentioned article for some more information and pointers that may help you with further development.

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

Sidebar

Related Questions

I have a problem with the Akamai API. I've used this system ( http://www.wsdltophp.com/
Doing a request for the data on an individual video such as: http://gdata.youtube.com/feeds/api/videos/K-YBQ_at_qU?v=2&alt=jsonc Used
Doing Android development on a Mac and this very new phone I have doesn't
Doing this: @resp = Net::HTTP.get_response(api.something.com, /feed/v1/offers.json?#{@params_api_string}) I get this response in @resp: #<Net::HTTPOK:0x7f451e9d3ef0> How
Doing some jquery animation. I have certain divs set up with an attribute of
Doing some code reviews lately I came across a number of classes that have
Doing tests through Firebug/Firefox, I'm attempting to run the simplest of commands to have
I have an App that does the pretty standard operation: It plays audio (streamed
Doing some work in javascript I have a multidimensional made up in this format
Doing some experiences to understand bit fields Hi have this code: 01 #include <stdio.h>

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.