基于Android系统的音乐播放器设计与实现含源程序.doc
《基于Android系统的音乐播放器设计与实现含源程序.doc》由会员分享,可在线阅读,更多相关《基于Android系统的音乐播放器设计与实现含源程序.doc(47页珍藏版)》请在三一办公上搜索。
1、基于Android系统的音乐播放器设计与实现源程序.ProjectspMusicPlayer01com.android.ide.eclipse.adt.ResourceManagerBuildercom.android.ide.eclipse.adt.PreCompilerBuilderorg.eclipse.jdt.core.javabuildercom.android.ide.eclipse.adt.ApkBuildercom.android.ide.eclipse.adt.AndroidNatureorg.eclipse.jdt.core.javanature.classpathAndr
2、oidManifest.xml LocalMpsList.javapackage sled.develop;import java.util.ArrayList;import java.util.List;import sled.develop.service.ListSrv;import sled.model.MpsIterm;import sled.utils.AdapterUtils;import sled.utils.AppConstant;import sled.utils.FileUtils;import android.app.ListActivity;import androi
3、d.content.Intent;import android.os.Bundle;import android.view.View;import android.view.Window;import android.widget.ListView;import android.widget.RadioButton;import android.widget.RadioGroup;import android.widget.RadioGroup.OnCheckedChangeListener;import android.widget.SimpleAdapter;public class Lo
4、calMpsList extends ListActivityprivate List mp3s =null;private RadioGroup radiogroup ; private RadioButton single ;private RadioButton order ;private RadioButton radom ;private int mode = AppConstant.JUMP_MODE_ORDER ;Overrideprotected void onCreate(Bundle savedInstanceState) / TODO Auto-generated me
5、thod stubsuper.onCreate(savedInstanceState);requestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.locallist);single = (RadioButton)findViewById(R.id.single);order = (RadioButton)findViewById(R.id.order);radom = (RadioButton)findViewById(R.id.radom);radiogroup = (RadioGroup)findViewBy
6、Id(R.id.menu);radiogroup.setOnCheckedChangeListener(new OnCheckedChangeListener() Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) / TODO Auto-generated method stubif(checkedId = single.getId()mode = AppConstant.JUMP_MODE_SINGLE;else if(checkedId = order.getId()mode = AppConstan
7、t.JUMP_MODE_ORDER;else if(checkedId = radom.getId()mode = AppConstant.JUMP_MODE_RADOM;);Overrideprotected void onListItemClick(ListView l, View v, int position, long id) / TODO Auto-generated method stubsuper.onListItemClick(l, v, position, id);/MpsIterm mp3=mp3s.get(position);Intent preintent = new
8、 Intent();preintent.putExtra(position, position);preintent.putExtra(cmd, AppConstant.JUMP_CMD_PREPARE);preintent.putExtra(mode, mode);preintent.setClass(LocalMpsList.this, ListSrv.class);startService(preintent);/*Intent intent=new Intent();intent.putExtra(mp3, mp3);intent.setClass(this, MpsPlayer.cl
9、ass);startActivity(intent);*/onStop();Overrideprotected void onResume() / TODO Auto-generated method stubsuper.onResume();updateListView();Overrideprotected void onStop() / TODO Auto-generated method stubsuper.onStop();finish();private void updateListView()FileUtils fileUtils=new FileUtils();mp3s=fi
10、leUtils.getMp3Files(mp3);if (mp3s=null)/如果本地目录找不到Mp3文件mp3s=new ArrayList();MpsIterm mp3=new MpsIterm();mp3.setName_mp3(没有Mp3文件!);mp3.setSize_mp3(0);mp3s.add(mp3);AdapterUtils au=new AdapterUtils(this,R.layout.mp3info_item,mp3s);SimpleAdapter simpleAdapter=au.buildSimpleAdapter();setListAdapter(simpl
11、eAdapter);ItrActivity.javapackage sled.develop;import android.app.Activity;import android.os.Bundle;public class ItrActivity extends ActivityOverrideprotected void onCreate(Bundle savedInstanceState) / TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.introduc
12、tion);Overrideprotected void onStop() / TODO Auto-generated method stubsuper.onStop();finish();MpsPlayer.javapackage sled.develop;import sled.develop.service.ListSrv;import sled.develop.service.PlayerSrv;import sled.utils.AppConstant;import android.app.Activity;import android.content.BroadcastReceiv
13、er;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.media.AudioManager;import android.os.Bundle;import android.os.Handler;import android.view.Menu;import android.view.M
14、enuItem;import android.view.MotionEvent;import android.view.View;import android.view.View.OnClickListener;import android.widget.ImageButton;import android.widget.ImageView;import android.widget.LinearLayout;import android.widget.SeekBar;import android.widget.TextView;public class MpsPlayer extends A
15、ctivity implements AppConstant private AudioManager am = null ;private IntentFilter intentFilter=null;private BroadcastReceiver receiver=null;private Intent playIntent=null;private Intent intentnext = null ;private Thread t = null ;private LinearLayout ll = null;private ImageButton last_btn = null ;
16、private ImageButton pause_btn = null ;private ImageButton play_btn = null ;private ImageButton next_btn = null ;private ImageButton list_btn = null ;private SeekBar seekbar = null ;private TextView time_view = null ;private TextView lrc_view = null ;private TextView mp3info_view = null ;private Imag
17、eView song_img = null ;private ImageView volbar = null ;private ImageView logo = null ;private int SysMaxVolume , CurVolume;private int vol_id = R.drawable.vol_0,R.drawable.vol_1,R.drawable.vol_2,R.drawable.vol_3,R.drawable.vol_4,R.drawable.vol_5,R.drawable.vol_6,R.drawable.vol_7;private int logo_id
18、 = R.drawable.logo_0,R.drawable.logo_1,R.drawable.logo_2,;int logo_index = 0 ;float downX = 0 ;float downY = 0 ;float upX = 0 ;float upY = 0 ;float relateX ;float relateY ;long tempT = 0 ;long downT = 0 ;long moveT = 0 ;long upT = 0 ;private float CLICK_POINTOR = 80 ;/int count = 0 ;Overrideprotecte
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 Android 系统 音乐 播放 设计 实现 源程序
链接地址:https://www.31ppt.com/p-2394077.html