title: Android: media player play from url :Failed to open file error
body: <p>I am trying to implement a simple media player in android that contains  only two buttons one for play another for pause </p>
  
  <p><strong>Play</strong></p>
  
  <pre><code>  String url = " http://host/audio/01_-_Pat.mp3";
   public void onClick(View v) {
                   try{
  
                       mPlayer.setDataSource(url);
                       mPlayer.setOnPreparedListener(MainActivity.this);
                       mPlayer.prepareAsync();
  
                   }catch (Exception e)
                   {
                       Log.v("Error", String.valueOf(e));
                       Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_LONG).show();
                   }
                   mPlayer.start();
               }
  </code></pre>
  
  <p>I didn't get any exception on this code but i will get this error
   *</p>
  
  <blockquote>
    <p>Failed to open file ' <a href="http://host.com/audio/01_-_Pat.mp3" rel="nofollow">http://host.com/audio/01_-_Pat.mp3</a>'. (No such
    file or directory)</p>
  </blockquote>
  
  <p>*
  Actually the url is valid and it contains the audio</p>