【正文】
stractToday39。Android的開放性就優(yōu)于其它封閉式的手機(jī)系統(tǒng),因此,任何人都可以根據(jù)自己的愛好將手機(jī)系統(tǒng)中的所有功能重新編寫。本文的音樂播放器就是基于谷歌Android手機(jī)平臺的播放器。使人們的生活更加多樣化,也使設(shè)計(jì)者更加熟悉基于Android平臺的應(yīng)用布局及開發(fā)模式的特點(diǎn),為以后實(shí)現(xiàn)更復(fù)雜的應(yīng)用打好基礎(chǔ)。2005年由Google收購注資,并組建開放手機(jī)聯(lián)盟開發(fā)改良,逐漸擴(kuò)展到平板電腦及其他領(lǐng)域上。我們的播放器實(shí)例也是用Java開發(fā)的。又如假設(shè)我們編寫了兩個(gè)應(yīng)用程序,其中一個(gè)程序中有列表顯示圖片的組件,那么我們在另外一個(gè)應(yīng)用程序中就可以使用該組件,而不需要再編寫該功能。這個(gè)界面可能有許多種不同的形式,比如有列表形式,有文字形式,有圖像格子等形式。()方法來設(shè)置一個(gè)activity中所要顯示的view。而顯示下載進(jìn)度、已下載文件等信息則由activity完成,同時(shí)我們還希望能控制下載過程,如停止、繼續(xù)等,這就需要activity與service之間進(jìn)行通信。它可以啟動一個(gè)activity來同用戶交互,也可以使用NotificationManager向用戶發(fā)出通知。ContentProvider類為我們提供了一系列保存數(shù)據(jù)的方法供我們調(diào)用,可以很方便地存儲數(shù)據(jù)。 Intent介紹所謂Intent,就是一種運(yùn)行時(shí)的綁定機(jī)制在應(yīng)用程序運(yùn)行時(shí)連接兩個(gè)不同的組件。,它除了包含有各個(gè)組件的信息,還包括許多其它的信息,它的基本樣式如下所示:?xml version= encoding=utf8?manifest . . . application . . . activity android:name= android:icon=drawable/ android:label=string/freneticLabel . . . /activity . . . /application/manifest不難看出,name,icon,lable這些屬性就分別指activity的名稱、圖標(biāo)、標(biāo)識。另外還需有600MB以上的剩余磁盤空間(官方文檔中的說明)。2. 找到變量名為path的項(xiàng),雙擊,在變量值后面添加:“。%JAVA_HOME%\lib\。安裝時(shí)可以根據(jù)自己的需求選擇安裝相應(yīng)的版本。2. 在Available Software 對話框中,點(diǎn)擊Add...。)4. 返回到Available Software 窗口后,就能看到列表中出現(xiàn)了Developer Tools ,選中它前面的復(fù)選框,再點(diǎn)擊“Next”,就會開始下載安裝ADT的各種組件了。3. 單擊SDK Location一欄邊的Browse按鈕,選擇剛剛下載的SDK保存的路徑。1. 打開Eclipse。5. 在Target一欄選擇一個(gè)Android虛擬機(jī)版本()。以下分別描述:音樂播放器的基本功能下載歌曲播放暫停停止音量控制歌曲列表播放文件退出圖41 播放器基本控制圖在播放器運(yùn)行時(shí),主界面是服務(wù)器的歌曲列表,可以點(diǎn)擊刷新列表,也可以點(diǎn)擊歌曲名,開始下載歌曲,然后點(diǎn)擊本地歌曲列表可以顯示出本地的歌曲文件,點(diǎn)擊文件名則跳轉(zhuǎn)到播放界面,在播放界面可以控制歌曲的播放、暫停、停止以及返回本地歌曲列表。能實(shí)現(xiàn)要求的功能,但又不重復(fù)。圖51 Mp3PlayerListActivity另一個(gè)是LocalActivity(圖52),這個(gè)Activity是點(diǎn)擊TabWidget控件中的“本地”按鈕才會顯示的本地歌曲列表界面。實(shí)現(xiàn)代碼如下:// 根據(jù)URL下載文本文件,必須是文本文件,因?yàn)榉祷刂凳俏谋局械淖址?public String download(String urlStr) { StringBuilder sb = new StringBuilder()。 // 創(chuàng)建一個(gè)連接 HttpURLConnection urlConn = (HttpURLConnection) url .openConnection()。 } finally { // 關(guān)閉buffer 節(jié)約資源 try { ()。圖52 XML文件結(jié)構(gòu)圖從上圖中可以看出所有的歌曲信息是包含在一個(gè)resources標(biāo)簽當(dāng)中的,而每一個(gè)resource標(biāo)簽就代表一首歌曲,其中的id、。 } //每讀完一個(gè)標(biāo)簽就清空tagName,以免出錯(cuò) tagName = 。 } else if (()) { (temp)。 // 生成一個(gè)下載線程,并將Mp3Info對象作為參數(shù)傳遞到線程對象當(dāng)中 DownloadThread downloadThread = new DownloadThread(mp3Info)。 } class DownloadThread implements Runnable { private Mp3Info mp3Info = null。 // 將文件下載下來 并存儲到SDcard中 int result = (mp3Url, mp3/, ())。 (resultMessage)。 } else if (result == 0) { resultMessage = 下載成功。 //SDCard路徑下的mp3文件夾下根據(jù)mp3Info中的mp3Name獲取mp3文件名,并返回完整文件路徑path String path = SDCardRoot + + mp3 + + ()。 Intent intent = getIntent()。 stopButton = (ImageButton) findViewById()。 (new PauseButtonListener())。 (false)。 } } } // 暫停監(jiān)聽器 class PauseButtonListener implements OnClickListener { public void onClick(View v) { //判斷媒體播放器中是否為空,是否處于停止或暫停狀態(tài),若是暫停,再次點(diǎn)下則為播放,若是播放則相反 if (mediaPlayer != null) { if (!isReleased) { if (!isPause) { ()。 } } } } } // 停止播放監(jiān)聽器 class StopButtonListener implements OnClickListener { public void onClick(View v) { //不處于停止?fàn)顟B(tài)時(shí)就進(jìn)入停止?fàn)顟B(tài) if (!isReleased) { isReleased = true。 }}}以上就是整個(gè)Android音樂播放器設(shè)計(jì)中比較重要的功能以及實(shí)現(xiàn)方法。3. 播放列表中顯示歌曲信息,一開始顯示的歌曲信息中文是有亂碼的,后來在網(wǎng)上查了一下,發(fā)現(xiàn)android支持的編碼方式是utf16,后來使用千千靜聽將歌曲信息更改為utf16的編碼方式,顯示終于正常了,看來android目前支持的編碼方式還有待加強(qiáng),畢竟是新出來不久的東西,還需要進(jìn)一步發(fā)展。致 謝近三個(gè)月時(shí)間的畢業(yè)課題設(shè)計(jì)是我大學(xué)生活中忙碌而又充實(shí)一段時(shí)光。借此論文之際,向所有幫助、關(guān)心、支持我的老師、朋友同學(xué),表達(dá)我最真誠的謝意。在這段時(shí)間里,我從他們身上,不僅學(xué)到了許多的專業(yè)知識,更感受到了他們工作中的兢兢業(yè)業(yè),生活中的平易近人的精神。當(dāng)我在畢業(yè)設(shè)計(jì)過程中遇到問題和困難時(shí),是他們給我提出許多關(guān)鍵性的意見和建議,使我對整個(gè)畢業(yè)設(shè)計(jì)的思路有了總體的把握,并耐心的幫我解決了許多實(shí)際問題,使我獲益良多??傊谝院蟮膶W(xué)習(xí)、工作、生活中我將更加努力,用自己的行動回報(bào)社會、學(xué)校、老師及同學(xué)。 your employer dismisses you and you think that you have been dismissed unfairly.For more information about dismissal and unfair dismissal, seeagainst the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal.Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are plaining about happened. If your application is received after this time limit, the tribunal will not usually accept i.If you are worried about how the time limits apply to you, take advice from one of the organisations listed undert charge you more than 35% of your pensation To find your nearest CAB, including those that give advice by , click ons 150th anniversary celebrations and will attend City39。for the racist behaviour of their fans durings actions.CSKA said they were surprised and disappointed by Toure39。總覺得自己自己似乎應(yīng)該去做點(diǎn)什么,或者寫點(diǎn)什么。t really grow up, it seems is not so important。Originally, this world, can produce a chemical reaction to an event, in addition to resolutely, have to do, and time. 原來,這個(gè)世界上,對某個(gè)事件能產(chǎn)生化學(xué)反應(yīng)的,除了非做不可的堅(jiān)決,還有,時(shí)間。也曾經(jīng)好像已經(jīng)下定了決心去做某件事,但更多的時(shí)候是最后又打起了退堂鼓。 Those were broken into various shapes of stationery。突然想到那件藍(lán)格子襯衫;那些被折成各種各樣形狀的信紙;那段從街角深巷伊始的友誼;還有那場還沒有開始就宣告了終結(jié)的邂逅計(jì)劃……那些年那些天的非做不可,終于和青春一樣,都將在我們的人生中謝幕。t. Baumgartner still will free fall at a speed that would cause you and me to pass out, and no parachute is guaranteed to work higher than 25,000 feet (7,620 meters).cause there。ll be traveling fast, so despite the distance, it will not be like diving into the deep end of a pool. It will be like he is diving into the shallow end. Skydiver preps for the big jumpWhen he jumps, he is expected to reach the speed of sound 690 mph (1,110 kph) in less than 40 seconds. Like hitting the top of the water, he will begin to slow as he approaches the more dense air closer to Earth. But this wi