基于android系统的音乐播放器设计与实现含源程序 毕业论文Word文档下载推荐.docx
- 文档编号:851913
- 上传时间:2023-04-29
- 格式:DOCX
- 页数:47
- 大小:36.67KB
基于android系统的音乐播放器设计与实现含源程序 毕业论文Word文档下载推荐.docx
《基于android系统的音乐播放器设计与实现含源程序 毕业论文Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《基于android系统的音乐播放器设计与实现含源程序 毕业论文Word文档下载推荐.docx(47页珍藏版)》请在冰点文库上搜索。
natures>
nature>
com.android.ide.eclipse.adt.AndroidNature<
/nature>
org.eclipse.jdt.core.javanature<
/natures>
/projectDescription>
.classpath
classpath>
classpathentrykind="
src"
path="
/>
gen"
classpathentry kind="
con"
path="
com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"
output"
bin"
/classpath>
AndroidManifest.xml
manifestxmlns:
android="
package="
sled.develop"
android:
versionCode="
1"
android:
versionName="
applicationandroid:
icon="
@drawable/icon"
label="
@string/app_name"
>
activityandroid:
name="
.MpsPlayer"
theme="
@android:
style/Theme.NoTitleBar.Fullscreen"
intent-filter>
actionandroid:
android.intent.action.MAIN"
/>
categoryandroid:
android.intent.category.LAUNCHER"
/intent-filter>
/activity>
.LocalMpsList"
style/Theme.Dialog"
.ItrActivity"
serviceandroid:
.service.PlayerSrv"
.service.ListSrv"
/application>
uses-sdkandroid:
minSdkVersion="
8"
/manifest>
LocalMpsList.javapackagesled.develop;
importjava.util.ArrayList;
importjava.util.List;
importsled.develop.service.ListSrv;
importsled.model.MpsIterm;
importsled.utils.AdapterUtils;
importsled.utils.AppConstant;
importsled.utils.FileUtils;
importandroid.app.ListActivity;
importandroid.content.Intent;
importandroid.os.Bundle;
importandroid.view.View;
importandroid.view.Window;
importandroid.widget.ListView;
importandroid.widget.RadioButton;
importandroid.widget.RadioGroup;
importandroid.widget.RadioGroup.OnCheckedChangeListener;
importandroid.widget.SimpleAdapter;
publicclassLocalMpsListextendsListActivity{privateList<
MpsIterm>
mp3s=null;
privateRadioGroupradiogroup;
privateRadioButtonsingle;
privateRadioButtonorder;
privateRadioButtonradom;
privateintmode=AppConstant.JUMP_MODE_ORDER;
@Override
protectedvoidonCreate(BundlesavedInstanceState){
//TODOAuto-generatedmethodstubsuper.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)findViewById(R.id.menu);
radiogroup.setOnCheckedChangeListener(newOnCheckedChangeListener(){
@Override
publicvoidonCheckedChanged(RadioGroupgroup,intcheckedId){
//TODOAuto-generatedmethodstubif(checkedId==single.getId()){
mode=AppConstant.JUMP_MODE_SINGLE;
}elseif(checkedId==order.getId()){
mode=AppConstant.JUMP_MODE_ORDER;
}elseif(checkedId==radom.getId()){
mode=AppConstant.JUMP_MODE_RADOM;
}
});
protectedvoidonListItemClick(ListViewl,Viewv,intposition,longid){
//TODOAuto-generatedmethodstubsuper.onListItemClick(l,v,position,id);
//MpsItermmp3=mp3s.get(position);
Intentpreintent=newIntent();
preintent.putExtra("
position"
position);
preintent.putExtra("
cmd"
AppConstant.JUMP_CMD_PREPARE);
mode"
mode);
preintent.setClass(LocalMpsList.this,ListSrv.class);
startService(preintent);
/*
Intentintent=newIntent();
intent.putExtra("
mp3"
mp3);
intent.setClass(this,MpsPlayer.class);
startActivity(intent);
*/onStop();
protectedvoidonResume(){
//TODOAuto-generatedmethodstubsuper.onResume();
updateListView();
protectedvoidonStop(){
//TODOAuto-generatedmethodstubsuper.onStop();
finish();
privatevoidupdateListView(){FileUtilsfileUtils=newFileUtils();
mp3s=fileUtils.getMp3Files("
);
if(mp3s==null){//如果本地目录找不到Mp3文件
mp3s=newArrayList<
();
MpsItermmp3=newMpsIterm();
mp3.setName_mp3("
没有Mp3文件!
"
mp3.setSize_mp3(0);
mp3s.add(mp3);
AdapterUtilsau=newAdapterUtils(this,R.layout.mp3info_item,mp3s);
SimpleAdaptersimpleAdapter=au.buildSimpleAdapter();
setListAdapter(simpleAdapter);
ItrActivity.java
packagesled.develop;
importandroid.app.Activity;
publicclassItrActivityextendsActivity{@Override
setContentView(R.layout.introduction);
MpsPlayer.java
importsled.develop.service.PlayerSrv;
importandroid.content.BroadcastReceiver;
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.IntentFilter;
importandroid.graphics.Bitmap;
importandroid.graphics.BitmapFactory;
importandroid.media.AudioManager;
importandroid.os.Handler;
importandroid.view.Menu;
importandroid.view.MenuItem;
importandroid.view.MotionEvent;
importandroid.view.View.OnClickListener;
importandroid.widget.ImageButton;
importandroid.widget.ImageView;
importandroid.widget.LinearLayout;
importandroid.widget.SeekBar;
importandroid.widget.TextView;
publicclassMpsPlayerextendsActivityimplementsAppConstant{privateAudioManageram=null;
privateIntentFilterintentFilter=null;
privateBroadcastReceiverreceiver=null;
privateIntentplayIntent=null;
privateIntentintentnext=null;
privateThreadt=null;
privateLinearLayoutll=null;
privateImageButtonlast_btn=null;
privateImageButtonpause_btn=null;
privateImageButtonplay_btn=null;
privateImageButtonnext_btn=null;
privateImageButtonlist_btn=null;
privateSeekBarseekbar=null;
privateTextViewtime_view=null;
privateTextViewlrc_view=null;
privateTextViewmp3info_view=null;
privateImageViewsong_img=null;
privateImageViewvolbar=null;
privateImageViewlogo=null;
privateintSysMaxVolume,CurVolume;
privateint[]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};
privateint[]logo_id={R.drawable.logo_0,
R.drawable.logo_1,R.drawable.logo_2,
};
intlogo_index=0;
floatdownX=0;
floatdownY=0;
floatupX=0;
floatupY=0;
floatrelateX;
floatrelateY;
longtempT=0;
longdownT=0;
longmoveT=0;
longupT=0;
privatefloatCLICK_POINTOR=80;
//intcount=0;
protectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ll=(LinearLayout)findViewById(R.id.control_view);
last_btn=(ImageButton)findViewById(R.id.last);
last_btn.setOnClickListener(newLastOnclickListener());
pause_btn=(ImageButton)findViewById(R.id.pause);
pause_btn.setOnClickListener(newPauseOnclickListener());
play_btn=(ImageButton)findViewById(R.id.play);
play_btn.setOnClickListener(newPlayOnclickListener());
next_btn=(ImageButton)findViewById(R.id.next);
next_btn.setOnClickListener(newNextOnclickListener());
list_btn=(ImageButton)findViewById(R.id.list);
list_btn.setOnClickListener(newListOnclickListener());
seekbar=(SeekBar)findViewById(R.id.progressbar);
seekbar.setOnSeekBarChangeListener(newSeekBarListener());
time_view=(TextView)findViewById(R.id.timeview);
lrc_view=(TextView)findViewById(R.id.lrcview);
mp3info_view=(TextView)findViewById(R.id.mp3_info);
song_img=(ImageView)findViewById(R.id.img_of_the_song);
volbar=(ImageView)findViewById(R.id.volfasebar);
logo=(ImageView)findViewById(R.id.logo);
protectedvoidonResume(){super.onResume();
am=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
SysMaxVolume=am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
receiver=newLrcMessBroadcastReceiver();
//两个参数,一个是指明操作,一个是指明过滤registerReceiver(receiver,getIntentFilter());
initPlayerSrv();
initListSrv();
dosomething(null,null);
publicbooleanonCreateOptionsMenu(Menumenu){
//TODOAuto-generatedmethodstubmenu.add(0,1,1,"
操作说明"
menu.add(0,2,2,"
完全退出"
returnsuper.onCreateOptionsMenu(menu);
publicbooleanonOptionsItemSelected(MenuItemitem){
//TODOAuto-generatedmethodstubif(item.getItemId()==1){
Intenttintent=newIntent();
tintent.setClass(MpsPlayer.this,ItrActivity.class);
startActivity(tintent);
elseif(item.getItemId()==2){stopService(playIntent);
stopService(intentnext);
finish();
returntrue;
protectedvoidonRestart(){super.onRestart();
protectedvoidonPause(){super.onPause();
unregisterReceiver(receiver);
//一些基本布局
publicvoiddosomething(Stringmp3info,Stringimg){
Bitmapbm;
if(mp3info==null||img==null){mp3info="
NOMUSICSELECTED"
;
song_img.setIma
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于android系统的音乐播放器设计与实现含源程序 毕业论文 基于 android 系统 音乐 播放 设计 实现 源程序