freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于android系統(tǒng)的midi音樂播放器的設計與實現(xiàn)畢業(yè)論文-資料下載頁

2025-07-02 11:19本頁面

【導讀】等詞越來越充斥于耳。隨著3G網(wǎng)絡的大規(guī)模建設和智能手機的迅速普及,移動互聯(lián)網(wǎng)。時代已經(jīng)微笑著迎面而來。手機用戶已達23億之多。消費者對手機產(chǎn)品在商務和娛樂方面的要求越來越高,讓手。機日益成為便攜式的商務或娛樂終端。在硬件的推動下,用戶對手機軟件的功能需求也。Android系統(tǒng)也在不斷更新以滿足需求,因此手機多媒體技術的開發(fā)也就不??杀苊夥Q為熱點。這使得越來越多的人關注這個操作系統(tǒng)。礎編程語言,采用Android系統(tǒng)提供的標準數(shù)據(jù)庫SQLite進行操作。本設計的實現(xiàn),囊。順序播放),也實現(xiàn)了對歌曲列表的搜索、添加和刪除等功能。

  

【正文】 ) 的相互嵌套,歌曲信息通過 ListView 控件顯示, 它以列表的形式展示具體內(nèi)容,并且能夠根據(jù)數(shù)據(jù)的長度自適應顯示 ,實現(xiàn)代碼如下所示 。 ListView android:id=@+id/musiclist android:layout_height=fill_parent android:layout_width=fill_parent android:layout_marginLeft=6dp android:layout_marginRight=6dp android:cacheColorHint=00000000 android:divider=@color/divider_color android:dividerHeight=1dp android:listSelector=@drawable/selector_list_item android:layout_below=@+id/relativeLayout1 /ListView 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 22 在歌曲播放列表 使用了 SlidingDrawer(滑動式抽屜)這個控件, SlidingDrawer隱藏屏外的內(nèi)容,并允許用戶通過 handle以顯示隱藏內(nèi)容 , 將播放控制界面放在了這個隱藏內(nèi)容中, 它可以垂直或水平滑動, 布局代碼實現(xiàn)如下所示。 android:id=@+id/slidingDrawer android:layout_width=fill_parent android:layout_height=fill_parent android:handle=@+id/handle android:content=@+id/content android:topOffset=10dp include layout=@layout/sliderdrawer_handle_layout/include include layout=@layout/sliderdrawer_content_layout/include / 有時 Android自帶的 SlidingDrawer控件 不能滿足開發(fā)者的需求, 重寫 SlidingDrawer這個控件, 將會為整個 系統(tǒng)的 界面布局增色不少 ,重寫實現(xiàn)代碼如下所示。 /* * 獲取控件的屏幕區(qū)域 */ public Rect getRectOnScreen(View view){ Rect rect = new Rect()。 int[] location = new int[2]。 View parent = view。 if(() instanceof View){ parent = (View)()。 } (location)。 (rect)。 (location[0], location[1])。 return rect。 } public boolean onInterceptTouchEvent(MotionEvent event) { // 觸摸位置轉換為屏幕坐標 int[] location = new int[2]。 int x = (int)()。 int y = (int)()。 (location)。 x += location[0]。 y += location[1]。 if(mTouchableIds != null){ for(int id : mTouchableIds){ 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 23 View view = findViewById(id)。 if (()) { Rect rect = getRectOnScreen(view)。 if((x,y)){ if (() == ) { if (mTouchViewClickListener != null) { (view)。 } } return true。 } } } } //抽屜行為控件 if(() == amp。amp。 mHandleId != 0){ View view = findViewById(mHandleId)。 Rect rect = getRectOnScreen(view)。 if((x, y)){//點擊抽屜控件時交由系統(tǒng)處理 { return (event)。 } }else{ return false。 } } return (event)。 } @Override public boolean onTouchEvent(MotionEvent event) { return (event)。 } } 播放控制界面設計 在 MIDI 音樂播放器界面設計中, 將播放控制界面放在了 SlidingDrawer 這個控件的隱藏內(nèi)容中,只需點擊歌曲列表界面的下方的按鈕,播放控制界面會從屏幕下方滑出也可以拖動, 也可以在此隱藏,如圖 所示。 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 24 圖 播放控制界面 播放控制界面中的重點布局 就是自定義的 SeekBar(拖動條)這個控件的實現(xiàn),如圖 所示,實現(xiàn)的方法就是修改 android:progressDrawable 和 android:thumb 這兩個屬性,這兩個屬性自己編寫,配置在 和 這兩個文件中, 實現(xiàn)代碼如下所示 。 SeekBar android:id=@+id/seekBar android:layout_width=fill_parent android:layout_height=wrap_content android:layout_toRightOf=@id/CurTime android:layout_toLeftOf=@id/TotalTime android:paddingLeft=5dp android:paddingRight=5dp android:max=100 android:progressDrawable=@drawable/seekbar_style android:thumb=@drawable/seekbar_thumb android:background=@drawable/progress_buffering /SeekBar : ?xml version= encoding=utf8? 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 25 layerlist xmlns:android= item android:id=@android:id/secondaryProgress clip android:drawable=@drawable/progress_buffering / item android:id=@android:id/progress clip android:drawable=@drawable/progress_playing / /layerlist : ?xml version= encoding=utf8? selector xmlns:android= item android:state_pressed=true android:drawable=@drawable/thumb_f / item android:drawable=@drawable/thumb_normal / /selector 播放器初始化 實現(xiàn) MIDI 音樂播放器運行之后,需要一個初始化的過程,這個過程實際就是對 SD 卡中所有音樂一個掃描的過程,即獲取所有音樂的相關信息 ,如歌曲的名字和演唱者等 。初始化過程中,獲取音樂的操作做在了一個線程 Thread 內(nèi),后臺進行查詢數(shù)據(jù)庫操作,線程實現(xiàn)代碼如下所示。 private ArrayListMusicData setMusicDatas() { // TODO Autogenerated method stub Cursor cursor=(, musicdata, null, null, null)。 if(cursor!=null){ ()。 int musicID=()。 int musicTitle=()。 int musicTime=()。 int musicArtist=()。 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 26 int musicPath=()。 int musicALBUM_ID=()。 int musicCount=()。 musicDatasList=new ArrayListMusicData() 。 for (int i = 0。 i musicCount。 i++) { musicData=new MusicData()。 ((musicID))。 ((musicTitle))。 ((musicTime))。 ((musicArtist))。 ((musicPath))。 ((musicALBUM_ID))。 (())。 (musicData)。 ()。 } ()。 return musicDatasList。 } return musicDatasList。 } private Handler mHandler = new Handler() { public void handleMessage(Message message) { Intent intent = new Intent()。 (context, )。 bundle=new Bundle()。 (musicList, musicList)。 (bundle)。 ((MiDiMusicActivity) context).startActivity(intent)。 內(nèi)蒙古科技大學畢業(yè)設計說明書(畢業(yè)論文) 27 ((MiDiMusicActivity) context).overridePendingTransition(, )。 //實現(xiàn)初始化界面淡出效果 ((MiDiMusicActivity) context).finish()。 (musiclist hava loaded!!)。 } }。 } 歌曲列表模塊 實現(xiàn) 數(shù)據(jù)庫創(chuàng)建和連接實現(xiàn) 本節(jié) 介紹 MIDI 播放器 如何進行 Android 數(shù)據(jù)庫連接, Android 中 自帶 SQLite 數(shù)據(jù)庫,這是一個十分小型的數(shù)據(jù)庫, 第二章已經(jīng)做過介紹 。 Android 數(shù)據(jù)庫存儲的位置在 data/data/項目文件夾 /databases/目錄下 。 Android 是利用 ContentProvider 作為內(nèi)容提供商, SQLiteOpenHelper 數(shù)據(jù)庫幫助類來進行對數(shù)據(jù)庫的創(chuàng)建和操作。通過 ()方法直接對數(shù)據(jù)庫進行操作。程序中數(shù)據(jù)庫類為 Data
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1