-
android 播放网络MP3 音乐播放
简单的基本功能,实测可行。 核心代码:package com.sharpandroid.music.activity;import java.io.IOException;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.widget.Button;import android.widget.ImageButton;import android.widget.SeekBar;import android.widget.TextView;import com.sharpandroid.music.R;import com.sharpandroid.music.StreamingMediaPlayer;public class MediaPlayer extends Activity { private Button streamButton; private ImageButton playButton; private boolean isPlaying; private TextView playTime; private StreamingMediaPlayer audioStreamer; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); initControls(); } private void initControls() { playTime=(TextView) findViewById(R.id.playTime); streamButton = (Button) findViewById(R.id.button_stream); streamButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { startStreamingAudio(); }}); playButton = (ImageButton) findViewById(R.id.button_play); playButton.setEnabled(false); playButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { if (audioStreamer.getMediaPlayer().isPlaying()) { audioStreamer.getMediaPlayer().pause(); playButton.setImageResource(R.drawable.button_play); } else { audioStreamer.getMediaPlayer().start(); audioStreamer.startPlayProgressUpdater(); playButton.setImageResource(R.drawable.button_pause); } isPlaying = !isPlaying; }}); } private void startStreamingAudio() { try { final SeekBar progressBar = (SeekBar) findViewById(R.id.progress_bar); if ( audioStreamer != null) { audioStreamer.interrupt(); } audioStreamer = new StreamingMediaPlayer(this, playButton, streamButton, progressBar,playTime); audioStreamer.startStreaming("http://192.168.64.1/xa.mp3",5208, 216); streamButton.setEnabled(false); } catch (IOException e) { Log.e(getClass().getName(), "读取音乐出错!", e); } }}
- 2014-05-26下载
- 积分:1
-
android高仿美食天下源码
android高仿美食天下源码
- 2015-06-09下载
- 积分:1
-
activity
Android activity美轮美奂的切换效果,令你的ui与众不同(Android activity beautiful transition effects, and make your ui distinctive)
- 2014-05-19 13:36:10下载
- 积分:1
-
开发源码分享之在线音乐播放器完整项目
这是一个android程序,主要是实现了一音乐播放器,是一个开源项目,我个人觉得比较好,有需要的朋友可以下载下来看看,适合学习
- 2022-03-16 17:13:40下载
- 积分:1
-
AuthenticatorDescription
A Parcelable value type that contains information about an account authenticator for Andriod.
- 2013-10-21 16:23:50下载
- 积分:1
-
CH06
android开发的一些例子很好用的非常好用真的好用哦(Some examples of good android developer with a very handy and easy to use Oh really)
- 2013-08-27 09:25:35下载
- 积分:1
-
C++函数库.docx (含相关示例代码)
【实例简介】
- 2021-08-08 00:31:02下载
- 积分:1
-
android 滑动删除例子源码下载
android 滑动删除例子源码下载
- 2015-04-22下载
- 积分:1
-
android控制电脑PPT 完整源码(无线鼠盘)
此实例含pc端源码和android源码,pc端的源码是C#语言,实现了 无线输盘 控制电脑等功能
- 2014-11-18下载
- 积分:1
-
android 5.1.1 APP开启关闭飞行模式
所需权限:
最后别忘了系统签名。
系统签名是公司的,我就不给了,自己找个吧。
- 2022-03-26 02:38:17下载
- 积分:1