title: Playing audio file in native audio player
body: <p>I'm trying to play audio which resides in <a href="http://www.fundamentalalvarado.com/assets/sermons/bible-doctrine-series/032413-pm-The%20Doctrine%20of%20the%20Devil.mp3" rel="nofollow">this</a> place, in android native mp3 player. I tried using MediaPlayer class, but didn't work. Tried using intent, but it worked on only samsung set. Please suggest some good material where I can play the linked mp3 audio in android native application. the path is fundamentalalvarado.com/assets/sermons/bible-doctrine-series/032413-pm-The Doctrine of the Devil.mp3. Does the space makes any difference.I am new to android.</p>
  
  <p>Here is the code.</p>
  
  <p>package com.example.audiotest;</p>
  
  <pre><code>import java.io.IOException;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.media.AudioManager;
  import android.media.MediaPlayer;
  import android.media.MediaPlayer.OnErrorListener;
  import android.media.MediaPlayer.OnPreparedListener;
  import android.net.Uri;
  import android.os.Bundle;
  import android.view.Menu;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Intent playIntent = new Intent(Intent.ACTION_GET_CONTENT, Uri.parse("http://www.fundamentalalvarado.com/assets/sermons/bible-doctrine-series/032413-pm-The%20Doctrine%20of%20the%20Devil.mp3"));
  //      playIntent.setType("audio/mp3");
          startActivity(Intent.createChooser(playIntent, "Select an audio player"));
  
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  }
  </code></pre>