ImageVerifierCode 换一换
格式:DOCX , 页数:36 ,大小:725.30KB ,
资源ID:26959977      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/26959977.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(基于android普通的音乐播放器的设计与实训软件技术.docx)为本站会员(b****4)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

基于android普通的音乐播放器的设计与实训软件技术.docx

1、基于android普通的音乐播放器的设计与实训软件技术 编号 xxx信息职业技术学院毕业论文题 目基于Android普通的音乐播放器的设计与实训学生姓名xx学 号xxx院 系 计算机与通信工程学院专 业软件技术班 级xx指导教师xx顾问教师二一六年六月摘 要本音乐播放器的开发的原因是,在当今大众娱乐的时代,音乐播放器已是越来越不可少,开发这个项目可以方便很多人。Android当前发展前景很不错,特别是在中国市场,中国智能手机用户花钱购买应用程序的意识淡薄,安卓主打免费和开放式系统,适合广大人群,安全系数一般,虽然没有IOS那样稳定易用,但开发前景仍然可观。随着社会的进步发展,人们生活水平的稳健

2、提高,越来越多的人们开始对娱乐生活有着各种各样的需求,其中,音乐以其独特的律动和韵味捕获了大多数人们的心。在这样的时代中,音乐播放器的使用也显得格外的讲究。本音乐播放器为满足广大用户对音乐体验的快感,结合了主流播放器的基本功能,并大胆创新,只为给广大用户带来极致的音乐享受。本音乐播放器基本实现了现如今主流音乐播放器的基本功能,基本符合大众对音乐播放器的需求。除此以外,本播放器还提供了下载功能以及波形图,左右声道等新鲜功能。满足各类用户的需求,带来前所未有的体验感。关键词1.android 2.音乐播放器 3.下载功能AbstractThe reason for the development

3、of the music player is that in the era of mass entertainment, music player is becoming more and more indispensable, the development of this project can be convenient for many people. Android is currently the development prospects are very good, especially in the Chinese market, Chinese smartphone us

4、ers spend money to buy application consciousness, Android main free and open system, suitable for the majority of the population, the factor of safety in general, although there is no IOS as stable and easy to use, but the prospects are still impressive.With the social progress and development, peop

5、les living standards improve the robustness of the, more and more people began to have a variety of demand for live entertainment, including music, with its unique rhythm and charm capture the heart of most people. In such an era, the use of music players also appears to be particularly stress.The m

6、usic player to meet the majority of users of the music experience of pleasure, combined with the basic features of the mainstream player, and bold innovation, only for the majority of users to bring the ultimate music to enjoy.The basic realization of the music player is now the mainstream music pla

7、yers basic functions, basically in line with the needs of the public music player. In addition, the player also provides download features as well as the waveform, the left and right channels, and other new features. Meet the needs of all kinds of users, bring an unprecedented sense of experience.Ke

8、ywords:1.android 2. music player 3.Download function第一章 绪论1.功能设计1.1.1主界面音乐播放管理 通过该模块,用户可以实现对音乐播放的管理,主要功能包括:a.播放/暂停:用户可以通过此功能对音乐实施播放或暂停控制。b.上一首:用户可以通过此功能切换音乐至上一首。c.下一首:用户可以通过此功能切换音乐至下一首。d.播放模式:用户可以通过此功能调节播放模式,包括顺序播放、循环播放和随机播放。e.进度条拖动:用户可以通过此功能调节音乐的播放进度。1.1.2通知栏音乐播放管理a.播放/暂停:用户可以通过此功能对音乐实施播放或暂停控制。b.上一

9、首:用户可以通过此功能切换音乐至上一首。c.下一首:用户可以通过此功能切换音乐至下一首。d.关闭:用户可以通过此功能直接关闭播放器。e.跳转:用户可以通过此功能从通知栏跳转至主界面。1.1.3音乐列表管理a.默认列表:用户打开列表自动搜索内存里的音乐,并导入默认列表。用户可通过此列表进行选择播放。b.喜欢列表:用户通过在默认列表中的选择,将喜欢的音乐导入喜欢列表。用户可通过此列表进行选择播放。c.下载列表:用户可通过网络下载喜欢的音乐至此列表,并进行选择播放。1.1.4设置管理a.背景设置:用户可通过此功能更换界面背景。b.搞怪3D音效:用户可通过此功能获取搞怪音效。c.语言设置:用户可通过此

10、功能来进行中英文切换。1.1.5双声道管理a.用户如果没有插入耳机,则出现波形图。b.用户如果插入耳机,则进行双声道管理。2.本论文的内容和结构说明软件设计采用IAR C语言软件开发系统,通过系统通讯主程序、路由子程序、传感器信号采集处理子程序、显示报警子程序等模块化软件设计,设计出使用简便、运行效率高、稳定可靠的配套软件系统。本文结构主要由绪论、音乐播放器的构成与组建、系统模块的介绍,流程图和关键代码实现。第1章:绪论,介绍音乐播放器的功能设计。第2章:系统设计,系统总体分析与设计,总体介绍项目的构成。第3章:系统实现的原理。第4章:系统测试。第5章:对项目的以后的展望和。系统顶层用例图如图

11、1: 图1 系统用例图第二章 系统设计2.1系统面向对象设计根据系统的需求分析,各功能模块所涉及的类如下:音乐列表类:功能:修改音乐类型信息,比如添加音乐数据、查询所有未被删除的音乐信息、添加删除喜欢音乐。属性:存储音乐类型信息,比如默认音乐类型有歌曲ID、名称、专辑名、歌手名、路径、播放时长、大小、重命名歌曲名等。音乐列表类图如图2.1图2.1 音乐列表类图2.2数据库设计系统采用SQLite关系型数据库进行数据库设计,由系统对象关系分析可知,系统数据存储结构可由一张数据表构成,其具体结构如表1所示。表1 音乐类型信息表表名account_type_info列名数据类型非空描述主键外键idi

12、ntegerY歌曲IDYtitletext歌曲的名称 albumtext歌曲的专辑名artisttext歌曲的歌手名urltext歌曲文件的路径durationtext歌曲的总播放时长musicnametext重命名歌曲名sizetext歌曲文件的大小statusinteger1标识不喜欢,2标识喜欢2.3主界面设计由于采用移动手持终端作为应用程序载体,为提高人机交互效果,主界面宜采用扁平化设计。可以更加简单直接的将信息和事物的工作方式展示出来,减少认知障碍的产生。主界面设计如图3.4所示。 图2.3 主界面设计第三章 系统实现3.1数据库存储系统的实现 本存储系统利用Andorid的SQLi

13、te关系型数据库存储系统实现。其数据表字段及数据表创建等核心代码如下所示: 数据表字段代码: private SQLiteDatabase mMusicListdb = null; private final String LIST_DBNAME = music_list; private final String TBL_MUSIC = tbl_music; private final String TITLE = tilte; private final String ALBUM = album; private final String ARTIST = artist; private

14、final String URL = url; private final String DURATION = duration; private final String SIZE = size; private final String MUSICNAME = musicname; private final String STATUS = status;3.2系统功能实现本音乐播放系统通过播放、音效、设置、关于、通知等其他系统共同实现。主界面以下功能:播放、列表、设置、关于。1.播放:音乐的播放控制;2.列表:音乐列表显示和更改;3.设置:更改背景、语言设置和3D音效;4.双声道和波形;

15、5.关于;6.通知栏音乐播放管理。3.2.1音乐信息添加功能的实现该功能主要是音乐信息的添加,点击主界面的列表按钮,打开音乐默认列表自动添音乐(如图3.1所示)。弹出等待提示框(如图3.2所示),音乐添加完成后将自动关闭并刷新列表。图3.1 音乐信息添加 图3.2 等待提示框添加音乐数据访问层(MusicListDao类)核心代码:public void initData(SdcardMusic sm) ContentValues cv = new ContentValues(); cv.put(TITLE, sm.getTilte(); cv.put(ALBUM, sm.getAlbum()

16、; cv.put(ARTIST, sm.getArtist(); cv.put(URL, sm.getUrl(); cv.put(DURATION, sm.getDuration(); cv.put(SIZE, sm.getSize(); cv.put(MUSICNAME, sm.getMusicname(); cv.put(STATUS, 1); mMusicListdb.insert(TBL_MUSIC, novalue, cv); mMusicListdb.close();添加音乐信息事件核心代码: if(new MusicListDao(view.getContext().findAl

17、lMusic().isEmpty() if(new MusicListDao(view.getContext().findAllMusic().isEmpty() showLoadDialog(false); new Thread() public void run() Vector als = new Vector(); als = CommonUtils.getMusicFromSdCard(view.getContext(); for(int i=0;i 30000) new MusicListDao(view.getContext().initData(als.elementAt(i)

18、; hand.sendEmptyMessage(0); ; .start(); else Toast.makeText(view.getContext(), R.string.application_no_music, Toast.LENGTH_SHORT).show(); 3.2.2音乐列表更改功能的实现该功能主要是负责音乐列表的查询和修改,点击默认列表界面的钻石图标,可将该音乐添加至我喜欢的音乐列表(如图3.3所示),选择右侧黄色标签可查看不同列表(如图3.4所示)。图3.3 添加至喜欢的音乐列表图3.4查看不同的音乐列表查询音乐信息数据访问层(MusicListDao类)核心代码publ

19、ic Vector findAllMusic() Vector vsm = new Vector(); Cursor c = mMusicListdb.rawQuery(select * from +TBL_MUSIC + where + STATUS + ?, new String0); c.moveToFirst(); while(!c.isAfterLast() SdcardMusic sm = new SdcardMusic(); sm.setId(c.getInt(0); sm.setTilte(c.getString(1); sm.setAlbum(c.getString(2);

20、sm.setArtist(c.getString(3); sm.setUrl(c.getString(4); sm.setDuration(c.getInt(5); sm.setSize(c.getInt(6); sm.setMusicname(c.getString(6); sm.setStatus(c.getInt(8); vsm.addElement(sm); c.moveToNext(); return vsm; 3.2.3服务器音乐下载功能的实现点击列表内的下载按钮可从服务器下载该音乐至本地(如图3.5所示)。等待下载完成后即可播放(如图3.6所示)。 图3.5 下载音乐至本地 图3

21、.6 下载完成客户端连接接收代码public static String IP = 192.168.191.2; public static int PORT = 5000; public static String music_title = Your Smile.mp3; public boolean connect() new Thread() public void run() try while (true) Socket socket = new Socket(IP , PORT); String local_file = Environment.getExternalStorag

22、eDirectory().getAbsolutePath() + /AdownloadMusic/; File f = new File(local_file); if (!f.exists() f.mkdirs(); local_file = f.getAbsolutePath() + / + music_title; File file = new File(local_file); InputStream ins = socket.getInputStream(); FileOutputStream fos = new FileOutputStream(file); BufferedIn

23、putStream bis = new BufferedInputStream(ins); BufferedOutputStream bos = new BufferedOutputStream(fos); byte buffer = new byte102400; int len = bis.read(buffer); while (len != -1) bos.write(buffer, 0, len); len = bis.read(buffer); fos.flush(); fos.close(); FileReader fr = new FileReader(file); Strin

24、g str = ; int val = ins.read(buffer); val = fr.read(); while (val != -1) str += (char) val; val = fr.read(); CommonData.downloading = 0; CommonData.handler_deletemusic.sendEmptyMessage(2); catch (Exception e) CommonData.downloading = 0; CommonData.handler_deletemusic.sendEmptyMessage(3); ; .start();

25、 return false; 服务端创建服务传输代码public static void main(String args) File file = new File(Your Smile.mp3); try ServerSocket socketServerSocket = new ServerSocket(5000,1,InetAddress.getByName(172.17.0.82); while(true) Socket socket = socketServerSocket.accept(); try OutputStream ops = socket.getOutputStrea

26、m(); BufferedOutputStream bos = new BufferedOutputStream(ops); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file); byte buffer = new byte102400; int len = bis.read(buffer); while(len != -1) bos.write(buffer,0,len); len = bis.read(buffer); bos.flush(); bos.close(); ops.flush(

27、); ops.close(); System.out.println(ok!); Thread.sleep(1000); catch (Exception e) e.printStackTrace(); catch (Exception e) e.printStackTrace(); 3.2.4设置功能的实现点击主界面的设置按钮即可调出设置菜单(如图3.7);点击背景设置按钮弹出背景选择界面长按即可设置成功(如图3.8);图3.7 设置菜单查看图3.8 背景设置成功背景设置关键代码public class ImageAdapter extends BaseAdapter private int

28、 mGalleryItemBackground; private Context context; public ImageAdapter(Context context) this.context = context; TypedArray typedArray = context.obtainStyledAttributes(R.styleable.Gallery); mGalleryItemBackground = typedArray.getResourceId(R.styleable.Gallery_android_galleryItemBackground, 0); typedArray.recycle(); Override public int getCount() return myImageIds.size(); Override public Object getItem(int position) return p

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1