西南科技大学本科生毕业论文 I
Android在线音乐播放器设计与实现
摘要:移动互联网发展瞬息万变,以往的随身听、MP3等千篇一律的播放设备已经越来越难以满足人们多样化的听音乐需求了,而市面上的音乐播放器APP却深陷商业的漩涡,盈利和用户体验总是难以成正比,看似琳琅满目的音乐应用却没有几款真正让用户喜欢的。在这样的背景下,课题基于Android开源平台,使用Java语言开发,采用Android Studio + Gradle工具构建,并依靠OkHttp+Gson提供网络框架,开发了一款Android在线音乐播放器。播放器支持播放在线音乐,上一曲、下一曲,切换播放模式,支持歌词与专辑封面显示,支持搜索、下载在线歌曲等基本功能,并扩展实现了夜间模式,定时关闭等功能,致力于给用户提供更舒心的听歌体验。论文给出详细的框架设计,系统流程设计,部分设计图及主要功能运行流程图,并对开发中遇到的主要问题进行了详细讨论,如通过Activity和Service通信实现后台播放。经过系统测试,系统实现了基本功能和扩展功能,性能达到了一定的指标。
关键词:在线音乐;播放器;定时关闭;Gradle;OkHttp
西南科技大学本科生毕业论文 II
Design and Implementation of Android-based
Online Music Player
Abstract: The development of mobile Internet is constantly changing, the previous Walkman, MP3 player and other devices have been stereotyped increasingly difficult to meet people's demand for a variety of music, and the music player market, APP has deep whirlpool business, earnings and proportional to the user experience is always difficult, seemingly dazzling music application did not allow several users to really like it. In this context, an object based on the Android open source platform developed using the Java language, using Android Studio + Gradle build tool, and rely OkHttp + Gson provide network framework, developed an Android online music player. Player supports playback of online music, the song, the next song, switch the playback mode, support for lyrics and album art display, supports searching, downloading songs online and other basic functions, and expanded to achieve a night mode, time off and other functions, is committed to to provide a more enjoyable experience of listening to music. Paper gives a detailed framework design, system design process, part of the design and operation of the main function of a flow chart, and the development of the main problems encountered were discussed in detail, for example, by Activity and Service Communication between Play in background. After testing the system, the system to achieve the basic functions and extensions, reach a certain performance targets.
Keywords: online music, player, time off, gradle, okhttp
西南科技大学本科生毕业论文 III
目录
第1章 绪论 .................................................................................................................... 1
1.1 背景 ................................................................................................................... 1 1.2 国内外现状 ....................................................................................................... 1 1.3 目标及范围 ....................................................................................................... 2 1.4 核心技术 ........................................................................................................... 3 第2章 Android音乐播放器需求分析 .......................................................................... 5
2.1 功能性需求分析 ............................................................................................... 5
2.1.1 本地音乐 ................................................................................................ 5 2.1.2 在线音乐 ................................................................................................ 6 2.1.3 在线搜索 ................................................................................................ 8 2.1.4 播放控制 ................................................................................................ 9 2.1.5 扩展功能 .............................................................................................. 12 2.2 非功能性需求分析 ......................................................................................... 14
2.2.1 软件性能指标 ...................................................................................... 14 2.2.2 软件兼容性 .......................................................................................... 14
第3章 Android音乐播放器系统概要设计 ................................................................ 15
3.1 主要设计内容 ................................................................................................. 15 3.2 设计思想 ......................................................................................................... 15 3.3 系统框架 ......................................................................................................... 16 3.4 系统功能 ......................................................................................................... 17
3.4.1 本地音乐 .............................................................................................. 17 3.4.2 在线音乐 .............................................................................................. 18 3.4.3 在线搜索 .............................................................................................. 18 3.4.4 播放控制 .............................................................................................. 19 3.4.5 扩展功能 .............................................................................................. 19 3.5 流程设计 ......................................................................................................... 19 第4章 Android音乐播放器存储设计 ........................................................................ 21
4.1 本地存储 ......................................................................................................... 21
西南科技大学本科生毕业论文 IV
4.2 远程存储 ......................................................................................................... 22 第5章 Android音乐播放器详细设计与实现 ............................................................ 23
5.1 系统架构详细设计 ......................................................................................... 23
5.1.1 系统架构方式分析 .............................................................................. 23 5.1.2 系统框架分析 ...................................................................................... 24 5.1.3 网络请求框架分析 .............................................................................. 27 5.1.4 数据缓存框架 ...................................................................................... 28 5.2 功能详细设计 ................................................................................................. 30
5.2.1 本地音乐详细设计 .............................................................................. 30 5.2.2 在线音乐详细设计 .............................................................................. 32 5.2.3 在线搜索详细设计 .............................................................................. 34 5.2.4 播放控制详细设计 .............................................................................. 35 5.2.5 扩展功能详细设计 .............................................................................. 37 5.2.6 功能设置详细设计 .............................................................................. 39 5.2.7 关于界面详细设计 .............................................................................. 41
第6章 Android音乐播放器系统测试 ........................................................................ 43
6.1 功能测试 ......................................................................................................... 43
6.1.1 测试环境 .............................................................................................. 43 6.1.2 测试用例 .............................................................................................. 43 6.1.3 测试结论 .............................................................................................. 44 6.2 兼容性测试 ..................................................................................................... 45 结论 .................................................................................................................................. 47 致谢 .................................................................................................................................. 48 参考文献 .......................................................................................................................... 49