【正文】
。這些數(shù)據(jù)可以保存在文件中,也可以保存在 SQLite 數(shù)據(jù)庫中,還可以以其它任何有效的方式保存。 Android 應(yīng)用程序的組件有以下四種: 一個(gè) activity 實(shí)際上表現(xiàn)出來的就是一個(gè)程序的界面。本項(xiàng)目是一款基于 Android 手機(jī)平臺(tái)的音樂播放器,使 Android 手機(jī)擁有個(gè)性的多媒體播放器,使手機(jī)顯得更加生動(dòng)靈活化,與人們更為接近,讓手機(jī)主人隨時(shí)隨地處于音樂旋律之中。本文主要是在 Android 系統(tǒng)上對(duì)音樂播放器應(yīng)用程序的設(shè)計(jì)與實(shí)現(xiàn)進(jìn)行討論,通過這一過程來進(jìn)一步學(xué)習(xí)與應(yīng)用 Android 平臺(tái),這樣對(duì)個(gè)人的未來發(fā)展也很有意義。本文的音樂播放器就是基于谷歌 Android 手機(jī)平臺(tái)的播放器。又如假設(shè)我們編寫了兩個(gè)應(yīng)用程序,其中一個(gè)程序中有列表顯示圖片的組件,那么我們?cè)诹硗庖粋€(gè)應(yīng)用程序中就可以使用該組件,而不需要再編寫該功能。它可以啟動(dòng)一個(gè) activity 來同用戶交互,也可以使用 NotificationManager 向用戶發(fā)出通知。另外還需有 600MB 以上的剩余磁盤空間(官方文檔中的說明)。 3. 在彈出的 Add Site 對(duì)話框中,任意填寫一個(gè)名字到 Name 一欄。 7. 點(diǎn)擊 Create AVD,這樣我們的一個(gè) Android 虛擬機(jī)就創(chuàng)建好了。 BufferedReader buffer = null。 //將每 個(gè)標(biāo)簽中的內(nèi)容賦值給 mp3Info實(shí)例對(duì)象中相應(yīng)的變量 if ((id)) { (temp)。 if (result == 1) { resultMessage = 下載失敗 。 beginButton = (ImageButton) findViewById()。 } else { ()。短短的時(shí)間里,我學(xué)到了很多的東西。t agree with the disciplinary action your employer has taken against you ? your employer dismisses you and you think that you have been dismissed unfairly. 貴陽學(xué)院畢業(yè)設(shè)計(jì)(論文) 30 For more information about dismissal and unfair dismissal, see Dismissal. You can make a claim to an employment tribunal, even if you haven39。s actions. CSKA said they were surprised and disappointed by Toure39。當(dāng)我在 畢業(yè)設(shè)計(jì) 過程中遇到問題和困難時(shí),是他們給我提出許多關(guān)鍵性的意見和建議,使我對(duì)整個(gè) 畢業(yè)設(shè)計(jì) 的思路有了總體的把握,并耐心的幫我解決了許多實(shí)際問題,使我獲益良多。 3. 播放列表中顯示歌 曲信息,一開始顯示的歌曲信息中文是有亂碼的,后來在網(wǎng)上查了一下,發(fā)現(xiàn) android 支持的編碼方式是 utf16,后來使用千千靜聽將歌曲信息更改為utf16 的編碼方式,顯示終于正常了,看來 android 目前支持的編碼方式還有待加強(qiáng),畢竟是新出來不久的東西,還需要進(jìn)一步發(fā)展。 (false)。 //SDCard路徑下的 mp3文件夾下根據(jù) mp3Info中的 mp3Name獲取 mp3文件名,并返回完整文件路徑path String path = SDCardRoot + + mp3 + + ()。 } class DownloadThread implements Runnable { private Mp3Info mp3Info = null。 圖 52 XML 文件結(jié)構(gòu)圖 從上圖中可以看出所有的歌曲信息是包含在一個(gè) resources 標(biāo)簽當(dāng)中的,而每一個(gè)resource 標(biāo)簽就代表一首歌曲,其中的 id、 、 、 標(biāo)簽都分表代表了歌曲的一條信息。 圖 51 Mp3PlayerListActivity 另一個(gè)是 LocalActivity(圖 52),這個(gè) Activity 是點(diǎn)擊 TabWidget 控件中的“本地”按鈕才會(huì)顯示的本地歌曲列表界面。 1. 打開 Eclipse。 貴陽學(xué)院畢業(yè)設(shè)計(jì)(論文) 9 安裝 SDK SDK( Software Development Kit) 初始包中有開發(fā) Android 程序所要用到的工具,它包括了從編譯到運(yùn)行 Android 應(yīng)用程序所需要的各種工具。 前面介紹的 Activity、 Service及 BroadcastReceiver組件之間的通信全部使用的是 Intent,但是各個(gè)組件使用的 Intent 機(jī)制不同。對(duì)于許多應(yīng)用程序來說, service 組件是至關(guān)重 要的。根據(jù) Android 的軟件框圖,其軟件層次結(jié)構(gòu)自 下而上分為以下幾個(gè)層次: 第一、操作系統(tǒng)層( OS) 第二、各種庫( Libraries)和 Android 運(yùn)行環(huán)境( RunTime) 第三、應(yīng)用程序框架( Application Framework) 第四、應(yīng)用程序( Application) Android 應(yīng)用軟件開發(fā)的核心技術(shù) Android 應(yīng)用開發(fā)語言 Java 是 Android 上的主流開發(fā)語言,各種支持也最完善。 Android 是基于 Linux內(nèi)核的軟件平臺(tái)和操作系統(tǒng),它包括移動(dòng)電話工作所需的全部軟件,而且不存在任何以往羈絆移動(dòng)產(chǎn)業(yè)創(chuàng)新的專有權(quán)障礙,并迅速發(fā)展成為智能移動(dòng)終端的操作系統(tǒng)。s increasingly fast pace of life in society, with the hardware of mobile devices bee increasingly sophisticated, people demand more and more mobile devices, high technology from the past to the present pursuit of the pursuit of visual and user experience, therefore, also gradually increased the system requirements. This article is in the Android system, music player application on the design and implementation to discuss the process through which to further study and application of Android, so the future development of personal sense. Music player of this paper uses Android opensource system technology, the use of Java language and Eclipse development tools for the preparation of the player code. At the same time gives a detailed system design process, some interface screenshots and the major function of flow, the paper also encountered in the process of development problems and solutions were discussed in detail, the music player, set download,play, pause, stop and other functions, good performance, in the Android system can run independently. MP3 is a pressed audio file format, as the player is limited to the application layer of the program, so not to go into the specific pression algorithm. Experiments show that, based on the Android platform, software development is simple, concise and easy to use, will bee the development direction of the next few years, have universal significance. Keywords: Android, music player, MP3 貴陽學(xué)院畢業(yè)設(shè)計(jì)(論文) III 目 錄 摘 要 ........................................................................................................................................ I Abstract ...................................................................................................................................II 第一章 引 言 ....................................................................................................................... 1 項(xiàng)目背景 .................................................................................................................. 1 編寫目的 .................................................................................................................. 1 第二章 Android 應(yīng)用軟件開發(fā)基礎(chǔ) ................................................................................... 3 Android 簡介 ............................................................................................................. 3 Android 應(yīng)用軟件開發(fā)的核心技術(shù) ......................................................................... 4 Android 應(yīng)用開發(fā)語言 ................................................................................. 4 Android 應(yīng)用程序組件 .................................................................................. 4 Intent 介紹 ..................................................................................................... 6 文件 ........................................................................ 6 第三章 搭建 Android 開發(fā)環(huán)境 .......................................................................................... 8 計(jì)算機(jī)配置 .............................................................................................................. 8 安裝 JDK.................................................................................................................. 8 安裝 Eclipse ...............................................