前言
Android 是全球最普及的行動作業系統,源自 Linux 核心,由 Google 主導開發的開放原始碼專案。本文從定義、發展史、核心架構到生態系統,完整勾勒 Android 全貌。
定義與名稱由來
- Android:英文意為「類人機器人」,中文慣稱「安卓」。
- 基於 Linux Kernel,採用 Apache 2.0 / GPLv2 授權開源。
- 主要運行於手機、平板、電視、車載、穿戴、IoT 等裝置。
發展歷程關鍵里程碑
| 年份 | 版本/代號 | 關鍵事件 |
| 2003 | -- | Andy Rubin 成立 Android Inc. 開發相機/手機 OS |
| 2005 | -- | Google 收購 Android Inc. |
| 2007 | -- | 成立開放手機聯盟 (OHA),釋出 SDK Beta |
| 2008 | 1.0 | HTC Dream (G1) 首款商用機上市 |
| 2009 | 1.5 Cupcake | 首個甜點代號,支援 Widget、虛擬鍵盤 |
| 2010 | 2.2 Froyo | JIT 編譯、支援 720p 錄影 |
| 2011 | 4.0 Ice Cream Sandwich | 手機/平板統一 UI、Holo 風格、Face Unlock |
| 2012 | 4.1 Jelly Bean | Project Butter 流暢度優化、Google Now |
| 2014 | 5.0 Lollipop | Material Design、ART Runtime、64 位元支援 |
| 2015 | 6.0 Marshmallow | 運行時權限、Doze 省電、指紋 API |
| 2017 | 8.0 Oreo | Picture-in-Picture、通知管道、Project Treble |
| 2019 | 10 (Q) | 暗黑模式、手勢導航、Scoped Storage |
| 2021 | 12 (S) | Material You、隱私儀表板、AVIF 支援 |
| 2023 | 14 (U) | 超大字型、區域語言、Health Connect |
核心架構五層模型
- Linux Kernel:驅動程式 (顯示、音訊、電源、Binder IPC)、記憶體管理、安全性 (SELinux)。
- HAL (Hardware Abstraction Layer):標準化介面隔離 Kernel 與上層,模組化 (audio.hardware, camera.hardware...)。
- Native Libraries & ART Runtime:
libc、OpenGL ES、SQLite、WebKit/Blink、ART (AOT/JIT 編譯、GC)。
- Java API Framework:Activity Manager、Window Manager、Package Manager、Notification Manager、Content Provider 等系統服務。
- System Apps:Settings、Phone、Contacts、Launcher、Play Store 等預載應用。
關鍵技術特色
- 應用沙箱:每個 App 獨立 UID、獨立進程、SELinux 強制存取控制。
- 四大組件:Activity、Service、BroadcastReceiver、ContentProvider,透過 Intent 通訊。
- Binder IPC:高效能跨進程通訊機制,支援單向/雙向、死亡通知。
- 權限模型:安裝時/執行時權限、簽名權限、特權應用。
- OTA 更新:A/B 無縫更新、Dynamic Partitions、Mainline 模組化更新。
生態系統與發展趨勢
- Google Play Services (GMS):核心 API (Maps、Location、Auth、Ads、ML Kit) 模組化更新,解決碎片化。
- Android Go / Android Automotive / Wear OS / Android TV:針對不同裝置形態優化。
- Project Mainline:核心模組 (媒體、權限、DNS、藍牙) 透過 Play Store 直接更新,無需整版 OTA。
- Rust 重寫核心組件:提升記憶體安全 (如 Bluetooth、Keystore、Media Codec)。
Android 以開放、模組化、多裝置適配著稱,持續演進中;深入理解其架構有助於開發高效能、安全、相容的應用。