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

正文內(nèi)容

移動端app應(yīng)用開發(fā)課程論(編輯修改稿)

2025-02-04 10:27 本頁面
 

【文章內(nèi)容簡介】 rack 是 Audio 輸出環(huán)節(jié)的類,其中最重要的接口是 write(),主要的函數(shù)如下所示。 class AudioTrack { typedef void (*callback_t)(int event, void* user, void *info)。 AudioTrack( int streamType, uint32_t sampleRate = 0, // 音頻的采樣律 int format = 0, //音頻的格式(例如 8位或者 16位的 PCM) int channelCount = 0, // 音頻的通道數(shù) int frameCount = 0, // 音頻的幀數(shù) uint32_t flags = 0, callback_t cbf = 0, void* user = 0, int notificationFrames = 0)。 void start()。 void stop()。 void flush()。 void pause()。 void mute(bool)。 ssize_t write(const void* buffer, size_t size)。 // …… 省略部分內(nèi)容 } AudioRecord 是 Audio 輸入環(huán)節(jié)的類,其中最重要的接口為 read(),主要的函數(shù)如下所示。 class AudioRecord { 湖北大學(xué)本科課程設(shè)計(論文) 9 public: AudioRecord(int streamType, uint32_t sampleRate = 0, // 音頻的采樣律 int format = 0, // 音頻的格式(例如 8位或者 16位的 PCM) int channelCount = 0, // 音頻的通道數(shù) int frameCount = 0, // 音頻的幀數(shù) uint32_t flags = 0, callback_t cbf = 0, void* user = 0, int notificationFrames = 0)。 status_t start()。 status_t stop()。 ssize_t read(void* buffer, size_t size)。 // …… 省略部分內(nèi)容 } AudioTrack 和 AudioRecord 的 read/write 函數(shù)的參數(shù)都是內(nèi)存的指針及其大小,內(nèi)存中的內(nèi)容一般表示的是 Audio 的原始數(shù)據(jù)( PCM 數(shù)據(jù))。這兩個類還涉及 Auido 數(shù)據(jù)格式、通道數(shù)、幀數(shù)目等參數(shù),可以在建立時指定,也可以在建立之后使用 set()函數(shù)進行設(shè)置。 在 libmedia 庫中提供的只是一個 Audio 系統(tǒng)框架, AudioSystem、 AudioTrack 和 AudioRecord 分別調(diào)用下層的 IAudioFlinger 、 IAudioTrack 和 IAudioRecord 來實現(xiàn)。另外的一個接口是IAudioFlingerClient,它作為向 IAudioFlinger 中注冊的監(jiān)聽器,相當(dāng)于使用回調(diào)函數(shù)獲取 IAudioFlinger運行時信息。 2. 手機淘寶系統(tǒng) 開發(fā) 首頁 要點分析 首頁 應(yīng)該注意兩點: 接受和發(fā)送數(shù)據(jù)不能出現(xiàn)數(shù)據(jù)的阻塞,不容就會出現(xiàn)閃退的情況;首頁相當(dāng)于整個 app 的臉面,所以首頁的 UI 設(shè)計非常重要,另外還要考慮 app 的頁面要適應(yīng)不同大小的屏幕,否則客戶體驗度就會急劇下降。 核心源碼 //初始化手機信息數(shù)據(jù) 湖北大學(xué)本科課程設(shè)計(論文) 10 private Boolean inintInfo(int num){ Id = new String[num]。 Brands = new String[num]。 Price = new String[num]。 Name = new String[num]。 Nettype = new String[num]。 Cpu = new String[num]。 Ram = new String[num]。 BCamera = new String[num]。 Screesize = new String[num]。 Battery = new String[num]。 ImgUrl=new String[num]。 return true。 } //獲取網(wǎng)絡(luò)請求結(jié)果 private String connServerForResult(String strUrl) { // HttpGet 對象 HttpGet Request = new HttpGet(strUrl)。 String strResult = 。 try { // HttpClient 對象 HttpClient Client = new DefaultHttpClient()。 // 獲得 HttpResponse 對象 HttpResponse Response = (Request)。 if (().getStatusCode() == ) { // 取得返回的數(shù)據(jù) strResult = (())。 } } catch (ClientProtocolException e) { (protocol error:+())。 ()。 (check,protocol error:+())。 solveNoConnection()。 } catch (IOException e) { (IO error:+())。 ()。 (check,IO error:+())。 solveNoConnection()。 湖北大學(xué)本科課程設(shè)計(論文) 11 } return strResult。 } //網(wǎng)絡(luò)請求錯誤時執(zhí)行 private Boolean solveNoConnection(){ connectRight=false。 (check,網(wǎng)絡(luò)請求錯誤處理! )。 (無網(wǎng)絡(luò)或網(wǎng)絡(luò)訪問失??! )。 return true。 } // 普通 Json 數(shù)據(jù)解析 private void parseJson(String strResult) { try { JSONObject jsonObj = new JSONObject(strResult)。 int count=((num).toString())。 Count=count。 inintInfo(count)。 (check,parseJson: +())。 JSONArray PhoneId=(Id)。 JSONArray brands=(Brands)。 JSONArray price=(Price)。 JSONArray name=(Name)。 JSONArray type=(Nettype)。 JSONArray cpu=(Cpu)。 JSONArray ram=(Ram)。 JSONArray bCamera=(BCamerab)。 JSONArray screesize=(Screesize)。 JSONArray battery=(Battery)。 JSONArray imgUrl=(ImgUrl)。 for(int i=0。icount。i++){ Id[i]=(i).toString()。 Brands[i]=(i)。 Price[i]=(i)。 Name[i]=(i)。 Nettype[i]=(i)。 Cpu[i]=(i)。 Ram[i]=(i)。 BCamera[i]=(i)。 Screesize[i]=(i)。 湖北大學(xué)本科課程設(shè)計(論文) 12 Battery[i]=(i)。 ImgUrl[i]=HomeUrl+(i)。 (check, parseJson 獲取圖片地址: +ImgUrl[i])。 } }catch (JSONException e) { (Json parse error:+())。 (check, Json parse error:+())。 (Json parse error:+())。 ()。 } } 運 行效果 圖 搜索頁 要點分析 搜索頁的核心點在于 webService 的接口要設(shè)計好,接受數(shù)據(jù)和發(fā)送數(shù)據(jù)的接口都要精心設(shè)計,尤其要注意緩沖模塊的設(shè)計,否則容易出現(xiàn)數(shù)據(jù)阻塞。在從 webService 獲取數(shù)據(jù)時,要考慮好對異常情況的處理,如果異常情況沒處理好, app 運行到這里就會出現(xiàn)閃退的情況。 湖北大學(xué)本科課程設(shè)計(論文) 13 核心源碼 //初始化手機信息數(shù)據(jù) private Boolean inintInfo(int num){ Id = new String[num]。 Brands = new String[num]。 Price = new String[num]。 Name = new String[num]。 Nettype = new String[num]。 Cpu = new String[num]。 Ram = new String[num]。 BCamera = new String[num]。 Screesize = new String[num]。 Battery = new String[num]。 ImgUrl=new String[num]。 return true。 } //獲取網(wǎng)絡(luò)請求結(jié)果 private String connServerForResult(String strUrl) { // HttpGet 對象 HttpGet Request = new HttpGet(strUrl)。 String strResult = 。 try { // HttpClient 對象 HttpClient Client = new DefaultHttpClient()。 // 獲得 HttpResponse 對象 HttpResponse Response = (Request)。 if (().getStatusCode() == ) { // 取得返回的數(shù)據(jù) strResult = (())。 } } catch (ClientProtocolException e) { (protocol error:+())。 ()。 (check,protocol error:+())。 solveNoConnection()。 } catch (IOException e) { 湖北大學(xué)本科課程設(shè)計(論文) 14 (IO error:+())。 ()。 (check,IO error:+())。 solveNoConnection()。 } return strResult。 } //網(wǎng)絡(luò)請求錯誤時執(zhí)行 private Boolean solveNoConnection(){ (check,網(wǎng)絡(luò)請求錯誤處理! )。 (無網(wǎng)絡(luò)或網(wǎng)絡(luò)訪問失敗! )。 return true。 } // 普通 Json 數(shù)據(jù)解析 private void parseJson(String strResult) { try { JSONObject jsonObj = new JSONObject(strResult)。 int count=((num).toString())。 Count=count。 inintInfo(count)。 (check,parseJson:
點擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1