Mp3 Music Player Application Development Using Android

Transcription

MP3 MUSIC PLAYER APPLICATION DEVELOPMENT USING ANDROIDByTan Siang KianA REPORTSUBMITTED TOUniversiti Tunku Abdul Rahmanin partial fulfillment of the requirementsfor the degree ofBACHELOR OF INFORMATION TECHNOLOGY (HONS)COMPUTER ENGINEERINGFaculty of Information and Communication Technology(Kampar Campus)JAN 2020

UNIVERSITI TUNKU ABDUL RAHMANREPORT STATUS DECLARATION FORMTitle:MP3 MUSIC PLAYER APPLICATION DEVELOPMENT USING ANDROIDAcademic Session: JAN 2020I, TAN SIANG KIANdeclare that I allow this Final Year Project Report to be kept inUniversiti Tunku Abdul Rahman Library subject to the regulations as follows:1.The dissertation is a property of the Library.2.The Library is allowed to make copies of this dissertation for academic purposes.Verified by,(Author’s signature)(Supervisor’s signature)Address:7,JALAN ROS MERAH 3/19,TAMAN JOHOR JAYA,81100 JOHOR BAHRU, JOHOR.Date:20/04/2020Ooi Chek YeeSupervisor’s nameDate:20/04/2020

MP3 MUSIC PLAYER APPLICATION DEVELOPMENT USING ANDROIDByTan Siang KianA REPORTSUBMITTED TOUniversiti Tunku Abdul Rahmanin partial fulfillment of the requirementsfor the degree ofBACHELOR OF INFORMATION TECHNOLOGY (HONS)COMPUTER ENGINEERINGFaculty of Information and Communication Technology(Kampar Campus)JAN 2020i

DECLARATION OF ORIGINALITYI declare that this report entitled “MP3 Music Player Application Development usingAndroid” is my own work except as cited in the references. The report has not beenaccepted for any degree and is not being submitted concurrently in candidature for anydegree or other award.Signature:Name:Tan Siang KianDate:20/04/2020iiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

ACKNOWLEDGEMENTI would like to express my sincere thanks to all those individuals who assisted me incompleting this Final Year Project. The project could not be going smoothly withoutthe help of these people.First of all, I would like to express my appreciation to my supervisor, Ts Dr. Ooi ChekYee. Dr. Ooi who has given me this bright opportunity to engage in this MP3 MusicPlayer app project that is very suitable for fresher developers to enhance my own skill,I feel a million thanks to you. It is the first time to establish an Android applicationproject in my life. You are my enlightenment mentor, and I will never forget your helpto me in the future.Furthermore, I would like to thanks to my moderator, Ts Dr. Khor Siak Wang. Dr. Khorhas given me valuable advice to learn from my mistakes and improve on them. Hisvaluable advice made me have more ideas for improvement after Final Year Project 1.Finally, I must say thanks to my whole family especially my parents for their love,comfort, support, and encouragement for me to keep moving forward in the face ofobstacles in my university life.iiiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

ABSTRACTThis project is about the mp3 music player application development using Android.The biggest difference between the music player and existing applications is that it iscompletely free for users to use. It will integrate the advantages of existing musicplayers on the market, as far as possible to mining out the existing music players'function, and then do the filtering in order to eliminate function that not practical or lowcost-effective. Also, it will be keep improved based on user feedback.In addition, depending on the user's usage scenario, the music player will also addsome modes, such as driving mode and night mode, to allow users to use the applicationin any situation or environment. Moreover, the music player will have audio trimfeatures, allowing users to trim the best part of their favorite song into phone ringtoneor alarm. On the other hand, the existing music players pay less attention to the controlof gestures. Therefore, the music player will solve the limitation by adding moregestures and shake the phone feature for media control to make it more user-friendlyand humanity.In a nutshell, the methodology for developing the mp3 music application used inthis project is the agile development cycle. The agile development cycle consists of sixphases, which is requirements analysis, planning, design, implementation ordevelopment, testing, and deployment. Due to the iterative and flexible nature of thisapproach, it is able to effectively adapt to users with changing requirements.ivBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

TABLE OF CONTENTSTITLE PAGE . .iDECLARATION OF ORIGINALITY . iiACKNOWLEDGEMENT . iiiABSTRACT .ivTABLE OF CONTENTS vLIST OF TABLES .ixLIST OF FIGURES.xLIST OF ABBREVIATIONS . xiiChapter 1 Introduction .11.1 Problem Statement .11.2 Background Information and Motivation .21.3 Objectives .31.4 Proposed Approach/Study .41.5 Highlight of What Have Been Achieved .51.6 Report Organization .5Chapter 2 Literature Review.62.1 Review on existing application .62.1.1 Review on YY Music .62.1.2 Review on Xiami Music .142.1.3 Review on JOOX Music.202.2 Critical Remarks of previous works .272.2.1 Strength and Weaknesses of previous works .272.2.2 Application Comparison .28Chapter 3 System Design .293.1 Site Map .293.2 Use Case Diagram .303.2.1 Use Case Description .313.3 Activity Diagram .363.3.1 Listen to music .363.3.2 Audio Trim .373.3.3 Sleep timer.383.3.4 Night mode .393.3.5 Change theme .403.3.6 Download song.413.4 System Wireframe .42Chapter 4 Methodology and Tools .554.1 Design Specifications .55vBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

4.1.1 Methodology .554.2 Tool to use .574.2.1 Software Requirement .574.2.2 Hardware Requirement.574.3 User requirements .584.4 System Performance Definition .594.5 Timeline.60Chapter 5 Implementation and Testing .615.1 Implementation.615.2 Testing .62Chapter 6 Conclusion.686.1 Project Review, Discussions and Conclusion .686.1.1 Project Achievement.696.1.2 Problem Encountered .706.2 Future Work .70BIBLIOGRAPHY .71APPENDICES A. A-1A.1 MusicAdapter.java . A-1A.2 MusicPagerAdapter.java. A-4A.3MyApplication.java . A-5A.4 ActivityScope.java . A-7A.5 AppComponent.java . A-7A.6 AppModule.java . A-8A.7 BaseActivity.java . A-9A.8 BaseFragment.java .A-11A.9 BasePresenter.java . A-13A.10 IBaseView.java . A-13A.11 EasyRecyclerViewAdapter.java. A-14A.12 CommonConstant.java . A-18A.13 FFTData.java . A-18A.14 AudioData.java . A-18A.15 CommonDialog.java. A-19A.16 CircleBarRenderer.java . A-24A.17 Renderer.java . A-27A.18 VisualizerView.java . A-29A.19 DensityUtils.java . A-34A.20 LogUtils.java . A-34A.21 FileUtils.java . A-35viBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

A.22 Md5Utils.java . A-37A.23 Mp3ScanUtils.java . A-38A.24 ScreenUtils.java . A-39A.25 RingTools.java . A-40A.26 Music.java . A-43A.27 DetectSwipeGestureDriver . A-44A.28 DetectSwipeGestureListener . A-45A.29 FileInfo.java . A-46A.30 FileChooseComponent.java. A-47A.31 HomeComponent.java . A-47A.32 MusicInfo.java . A-48A.33 HomeModule.java . A-52A.34 FileChooseModule.java . A-52A.35 FileChooseContract.java . A-53A.36 HomeContract.java . A-54A.37 FileChoosePresenter.java . A-56A.38 HomePresenter . A-58A.39 CutFragment.java . A-66A.40 FileChooserActivity.java . A-76A.41 Mp3NameConvertUtils.java . A-81A.42 Mp3InfoUtils.java . A-82A.43 Mp3CutLogic.java . A-84A.44 AllFragment.java . A-88A.45 DriverMusicActivity.java . A-97A.46 MainActivity.java . A-104A.47 MusicActivity.java .A-117A.48 ThemeEnum.java . A-128A.49 MusicFragment.java . A-129A.50 RootActivity.java . A-132A.51 ThemeColor.java . A-133A.52 SplashActivity.java . A-134A.53 ShakeListener.java . A-139A.54 ShakeService.java. A-142A.55 ThemeColorAdapter.java. A-144A.56 BasePreference.java . A-145A.57 ThemeColorSelectDialog.java. A-146A.58 AppPreference.java. A-148A.59 AuxiliaryPreference.java . A-150viiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

A.60 BroadcastManager.java . A-151A.61 ThemeChangeable.java . A-152A.62 Common.java . A-152A.63 PeriodicTask.java . A-153A.64 Utils.java . A-154A.65 TimeSleepActivity.java . A-155A.66 AnimationUtils.java . A-164A.67 BlurUtil.java . A-165A.68 ColorUtils.java . A-171A.69 MergeImage.java . A-175A.70 activity driver.xml . A-176A.71 activity filechooser show.xml . A-178A.72 activity main.xml . A-180A.73 activity music.xml . A-181A.74 activity splash.xml . A-185A.75 activity time sleep.xml. A-190A.76 dialog common.xml . A-191A.77 dialog theme color.xml . A-193A.78 fragment all.xml . A-194A.79 fragment cut.xml . A-196A.80 fragment music.xml . A-199A.81 item musicfile.xml . A-201A.82 item theme color.xml . A-202A.83 music item.xml . A-203A.84 time sleep content.xml . A-205A.85 time sleep content picker.xml .A-211POSTERPLAGIARISM CHECK RESULTviiiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

LIST OF TABLESTable NumberTitlePageTable 2-2-1-1Strength and Weaknesses of reviewed application27Table 2-2-2-1Comparison among reviewed and proposed application28Table 3-2-1-1Use Case Description of Listen to music -----------------31Table 3-2-1-2Use Case Description of Progress bar31Table 3-2-1-3Use Case Description of Driving mode32Table 3-2-1-4Use Case Description of Night mode32Table 3-2-1-5Use Case Description of Shake Control33Table 3-2-1-6Use Case Description of Gesture Control33Table 3-2-1-7Use Case Description of Audio trim34Table 3-2-1-8Use Case Description of Set as ringtone or alarm34Table 3-2-1-9Use Case Description of Search music online35Table 5-2-1-1Unit Testing of Music Player Module62Table 5-2-2-1Unit Testing of Media Icon Button Playback Control Module63Table 5-2-3-1Unit Testing of Driver Mode Module64Table 5-2-4-1Unit Testing of Swipe Gesture Playback Control Module64Table 5-2-5-1Unit Testing of Shaking Playback Control Module65Table 5-2-6-1Unit Testing of Audio Trim Module65Table 5-2-7-1Unit Testing of Sleep Timer Module66Table 5-2-8-1Unit Testing of Night Mode Module67Table 5-2-9-1Unit Testing of Change Theme Color Module67ixBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

LIST OF FIGURESFigure NumberFigure 1-1TitlePage--System Flowchart of MP3 Music Player4Figure 2-1-1-1Homepage of YY Music6Figure 2-1-1-2Playlists recommended by YY Music7Figure 2-1-1-3Search page of YY Music8Figure 2-1-1-4Music playback control interface and download9----song optionFigure 2-1-1-5Music play control interface and download song option10Figure 2-1-1-6FM radio page of YY Music11Figure 2-1-1-7Setting page and Floating Window Feature12Figure 2-1-1-8Timer feature13Figure 2-1-2-1Main page of Xiami Music14Figure 2-1-2-2Four categories of the main page and subcategories15for each genreFigure 2-1-2-3Discover page of Xiami Music16Figure 2-1-2-4Video and News page of Xiami Music17Figure 2-1-2-5Driving Mode of Xiami Music18Figure 2-1-2-6Night Mode of Xiami Music19Figure 2-1-3-1Main page of JOOX20Figure 2-1-3-2Me page and local song on the user device21Figure 2-1-3-3My Karaoke feature and recording editor22Figure 2-1-3-4Playlist and Artists category under Discover page23Figure 2-1-3-5Radio and Live page of JOOX24Figure 2-1-3-6Music playback control page and sharing song features25Figure 2-1-3-7VIP privileges are required26Figure 3-1-1-1Site Map Diagram29Figure 3-2-1-1Use case diagram of MP3 Music Player Application30Figure 3-3-1-1Activity Diagram for User to Listen to Music36Figure 3-3-2-1Activity Diagram for User Using Audio Trim Feature37Figure 3-3-3-1Activity Diagram for User Enable Sleep Timer38Figure 3-3-4-1Activity Diagram for User Enable Night Mode39Figure 3-3-5-1Activity Diagram for User to Change Theme of Tool Bar40Figure 3-3-6-1Activity Diagram for User to Download Song41Figure 3-4-1Figure 3-4-2-1Figure 3-4-3-1- -Splash screen----- -Home page-42---English Song Playlist4143xBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

Figure 3-4-4-1Others Song Playlist42Figure 3-4-5-1Filtering Song Using the Search Bar and Alphabet44-Quick ScrollbarFigure 3-4-6-1Song Playing Page45Figure 3-4-7-1Song Playback Mode46Figure 3-4-8-1Driver Mode47Figure 3-4-9-1Audio Trim Feature48Figure 3-4-10-Select Music Page48Figure 3-4-11-The Process of Cut Song49Figure 3-4-12-Set the Trimmed Song as Ringtone50Figure 3-4-13-Generated Trimmed Song50Figure 3-4-14-Enable Sleep Timer51Figure 3-4-15-Disable Sleep Timer52Figure 3-4-16-Enable Night Mode53Figure 3-4-17-Change Theme Color of Toolbar54Figure 3-4-18-Download Song54Figure 4-1-1-1Agile Development Cycle (Devcrew.io, 2017)55Figure 4-5-1-Gantt chart for FYP160Figure 4-5-2-Gantt chart for FYP260xiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

LIST OF ABBREVIATIONSAppsApplicationsCPUCentral processing unitIOSiPhone Operating SystemMVMusic VideoMP3MPEG 1 Audio Layer 3MP4MPEG LAYER 4UIUser interfaceUTARUniversiti Tunku Abdul RahmanVIPVery Important PersonXMLFull extensible markup languageAPKAndroid Application PackagexiiBIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

Chapter 1 IntroductionChapter 1 Introduction1.1 Problem StatementThe problem domains on this project are:1.Bloated software and user interfacesDue to the fierce competition between music player applications, many developers triedto add many features, advertise and content to their respective music player in order toretain their users and attract new users. This trend has made it harder for users to getcontent from their music player, which also means it's harder to filter the content thatthey want. With the continuous iteration of application and a growing number offeatures, the music player will become even more bloated and the user's experience willbecome less smooth. Based on Mehul (2018), users tend to feel frustrated and angry ifthey take a long time to get a reply from the mobile application, so they will neverreturn to the same application, and 48% of users will simply uninstall or stop using it.2.Lack of gestures to controlMost music player apps use touch buttons to play, pause and switch between previousand next songs while ignoring the convenience of using gesture swiping to control themusic player. For instance, when a user is working and intends to skip to the next songin the music player, he/she have to switch their attention to the console from work andclick the button. This problem does not affect music player properly work, but it doeshave some inconvenience. However, according to Scacca (2020) said that as ourphysical devices and appliances develop the button-free design, consumers will becomemore comfortable and confident in this way of interaction, so we should consider usinggesture control on more mobile applications.3.Lack of sorting and searching featuresWhen users continuously to add new songs into the playlist, the difficulty of the songsthe user wants to filter will increase. After the songs in the playlist are added to reachhundreds of songs, the user can only search song by continuously swipe up or down. Ifnot carefully check the content, it is possible to miss the songs that the user wants tofilter, and then repeat the behavior until the result is found. Therefore, it is an extremelypoor experience for users.1BIS (Hons) Information Systems EngineeringFaculty of Information and Communication Technology (Kampar Campus), UTAR.

Chapter 1 Introduction1.2 Background Information and MotivationIn modern society, people live a fast-paced life, and pressure is constantly presentin lives. Due to the wide use of mobile phones, music has become the daily essentialspiritual food, everyone's mobile phone inside there must be a music player. Anapplication like MP3 music players is used to balance stress and happiness. Itaccompanies people anytime, anywhere and anyplace such as when people taking thebus and exercising.The mobile MP3 music player application is designed to allow users

UNIVERSITI TUNKU ABDUL RAHMAN REPORT STATUS DECLARATION FORM Title: MP3 MUSIC PLAYER APPLICATION DEVELOPMENT USING ANDROID Academic Session: JAN 2020 I, TAN SIANG KIAN declare that I allow this Final Year Project Report to be kept in