編輯:Android 開發教學
若需要儲存關聯式資料,SQLite 是 Android 常見選擇。可建立 DBAdapter 作為資料庫輔助類,封裝建立、開啟、關閉與操作邏輯。
以 MyDB 為例,建立 contacts 表,包含 _id、name、email 三個欄位。DBAdapter 可透過 SQLiteOpenHelper 建立資料庫,並提供 insert、delete、query、update 等方法。

Android適配不同螢幕大小:wrap_content、match_parent與配置
Android裝置螢幕尺寸差異大,若布局寫死寬高,容易在不同手機或平板上出現間距過大、控件變形等問題。要讓應用自適應,可從布局屬性與資源配置兩方面著手。使用wrap_co
ApiDemos 解析(10):用 Content Provider 讀取聯絡人
QuickContactsDemo 示範如何透過 Content Provider 存取 Android 系統的聯絡人資料庫。 Content Provider 的定位
Android 簡明開發教程二:安裝與設定開發環境
第一篇簡要介紹了 Android 平台,本篇說明如何架起開發環境。 平台與工具選擇 Android 開發支援 Windows(XP 32-bit、Vista 32/64-
Android 簡明開發教程二十二:用資源系統取代硬編碼
前面的示例刻意簡化,直接在程式碼與版面中寫死了字串常數,例如: <Button android:text="Pattern" and