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

正文內(nèi)容

安卓記事本畢業(yè)論文正稿(已改無錯(cuò)字)

2023-07-24 17:11:17 本頁面
  

【正文】 ic).toString())。 } 通過網(wǎng)絡(luò)來獲取和保存數(shù)據(jù)資源,將數(shù)據(jù)存儲(chǔ)到網(wǎng)絡(luò)上的方法很多,比如將要保存的數(shù)據(jù)以文件的方式上傳到服務(wù)器,發(fā)送郵件等. 下面我們看下如何實(shí)現(xiàn)讀取網(wǎng)絡(luò)文件. String myString = null。 try { /* 定義我們要訪問的地址url */ URL uri = new URL(:8080/)。 /* 打開這個(gè)url連接 */ URLConnection ucon = ()。 /* 從上面的鏈接中取得InputStream */ InputStream is = ()。 BufferedInputStream bis = new BufferedInputStream(is)。 ByteArrayBuffer baf = new ByteArrayBuffer(100)。 int current = 0。 /* 一直讀到文件結(jié)束 */ while ((current = ()) != 1) { ((byte) current)。 } myString = new String(())。 } catch (Exception e) { myString = ()。 } 另外由于在程序中訪問了外部網(wǎng)絡(luò),代碼如下 usespermissiion android:name=””/ ,不能在不同程序間共享數(shù)據(jù). /*創(chuàng)建和打開數(shù)據(jù)庫*/mSQLiteDatabase = (DATABASE_NAME, MODE_PRIVATE, null)。 /*創(chuàng)建表*/(CREATE_TABLE)。 /* 刪除數(shù)據(jù)庫 */ public void DeleteDataBase() { (DATABASE_NAME)。 ()。 } /* 刪除一個(gè)表 */ public void DeleteTable() { (DROP TABLE + TABLE_NAME)。 ()。 } /* 更新一條數(shù)據(jù) */ public void UpData() { ContentValues cv = new ContentValues()。 (TABLE_NUM, miCount)。 (TABLE_DATA, 修改后的數(shù)據(jù) + miCount)。 /* 更新數(shù)據(jù) */ (TABLE_NAME, cv, TABLE_NUM + = + (miCount 1), null)。 UpdataAdapter()。 } /* 向表中添加一條數(shù)據(jù) */ public void AddData() { ContentValues cv = new ContentValues()。 (TABLE_NUM, miCount)。 (TABLE_DATA, 測(cè)試數(shù)據(jù)庫數(shù)據(jù) + miCount)。 /* 插入數(shù)據(jù) */ (TABLE_NAME, null, cv)。 miCount++。 UpdataAdapter()。 } /* 從表中刪除指定的一條數(shù)據(jù) */ public void DeleteData() { /* 刪除數(shù)據(jù) */ (DELETE FROM + TABLE_NAME + WHERE _id= + (miCount))。 miCount。 if (miCount 0) { miCount = 0。 } UpdataAdapter()。 } /* 更行試圖顯示 */ public void UpdataAdapter() { // 獲取數(shù)據(jù)庫Phones的Cursor Cursor cur = (TABLE_NAME, new String[] { TABLE_ID, TABLE_NUM, TABLE_DATA }, null, null, null, null, null)。 miCount = ()。 if (cur != null amp。amp。 () = 0) { // ListAdapter是ListView和后臺(tái)數(shù)據(jù)的橋梁 ListAdapter adapter = new SimpleCursorAdapter(this, // 定義List中每一行的顯示模板 // 表示每一行包含兩個(gè)數(shù)據(jù)項(xiàng) , // 數(shù)據(jù)庫的Cursor對(duì)象 cur, // 從數(shù)據(jù)庫的TABLE_NUM和TABLE_DATA兩列中取數(shù)據(jù) new String[] { TABLE_NUM, TABLE_DATA }, // 與NAME和NUMBER對(duì)應(yīng)的Views new int[] { , })。 /* 將adapter添加到m_ListView中 */ (adapter)。 } } 數(shù)據(jù)存儲(chǔ)之ContentProviders ContentProviders: Android提供的一個(gè)特殊的存儲(chǔ)數(shù)據(jù)的類型,它提供了一套標(biāo)準(zhǔn)的接口來獲取,操作數(shù)據(jù).  查詢數(shù)據(jù):()()方法  修改數(shù)據(jù):()方法可以用來修改數(shù)據(jù)  添加數(shù)據(jù):()方法來增加一條數(shù)據(jù)  刪除數(shù)據(jù):()方法來刪除一條記錄 第五章 程序的開發(fā)     當(dāng)選擇”新建記事本”,”編輯內(nèi)容”,”刪除當(dāng)前記事”等菜單選項(xiàng)時(shí)對(duì)應(yīng)的操作  public boolean onOptionsItemSelected(MenuItem item) { switch (()) { // 插入一條數(shù)據(jù) case MENU_ITEM_INSERT: Intent intent0 = new Intent(this, )。 ()。 (getIntent().getData())。 startActivity(intent0)。 return true。 // 編輯當(dāng)前數(shù)據(jù)內(nèi)容 case MENU_ITEM_EDIT: Intent intent = new Intent(this, )。 (().getData())。 ()。 startActivity(intent)。 return true。 // 刪除當(dāng)前數(shù)據(jù) case MENU_ITEM_DELETE: Uri uri = (getIntent().getData(), getListView().getSelectedItemId())。 getContentResolver().delete(uri, null, null)。 renderListView()。 } return (item)。 } protected void onCreate(Bundle savedInstanceState) {(savedInstanceState)。//setTheme()。f
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1