1、添加文件头
import android.media.MediaPlayer;
import android.net.Uri;
2、创建播放器并播放
public void PlayMusicFromWeb(){
try
{
Uri file = Uri.parse("http://www.perlgurl.org/podcast/archives” +" +
" “/podcasts/PerlgurlPromo.mp3");
mp = MediaPlayer.create(this, file);
mp.start();
Log.i(DEBUG_TAG, "loc:" + "MediaPlayer start.");
}
catch(Exception e)
{
Log.i(DEBUG_TAG, "Plyer failed", e);
}
}