學了這么久的Android,竟然一直對其API對應的名稱關系一值搞不清楚,現在網上認真看了下資料,轉載一個覺得寫得不錯的作者的文章,記下來:
【背景】
之前折騰android期間,慢慢地知道了,Android的版本,有個API Level,其實就是對應着某個Android發布版本的名稱。
現在去總結一下。
【折騰過程】
1.參考了:
Supporting Different Platform Versions
Codenames, Tags, and Build Numbers
總結如下:
| Android版本名和API Level關系全稱 |
Android的版本 |
Android版本名稱Code name |
Android的API level |
| Android 1.0 (API level 1) |
1.0 |
(no code name) |
API level 1 |
| Android 1.1 (API level 2) |
1.1 |
(no code name) |
API level 2 |
| Android 1.5 Cupcake (API level 3) |
1.5 |
Cupcake |
API level 3, NDK 1 |
| Android 1.6 Donut (API level 4) |
1.6 |
Donut |
API level 4, NDK 2 |
| Android 2.0 Eclair (API level 5) |
2.0 |
Eclair |
API level 5 |
| Android 2.0.1 Eclair (API level 6) |
2.0.1 |
Eclair |
API level 6 |
| Android 2.1 Eclair (API level 7) |
2.1 |
Eclair |
API level 7, NDK 3 |
| Android 2.2–2.2.3 Froyo (API level 8) |
2.2.x |
Froyo |
API level 8, NDK 4 |
| Android 2.3–2.3.2 Gingerbread (API level 9) |
2.3 – 2.3.2 |
Gingerbread |
API level 9, NDK 5 |
| Android 2.3.3–2.3.7 Gingerbread (API level 10) |
2.3.3 – 2.3.7 |
Gingerbread |
API level 10 |
| Android 3.0 Honeycomb (API level 11) |
3.0 |
Honeycomb |
API level 11 |
| Android 3.1 Honeycomb (API level 12) |
3.1 |
Honeycomb |
API level 12, NDK 6 |
| Android 3.2 Honeycomb (API level 13) |
3.2.x |
Honeycomb |
API level 13 |
| Android 4.0–4.0.2 Ice Cream Sandwich (API level 14) |
4.0.1 – 4.0.2 |
Ice Cream Sandwich |
API level 14, NDK 7 |
| Android 4.0.3–4.0.4 Ice Cream Sandwich (API level 15) |
4.0.3 – 4.0.4 |
Ice Cream Sandwich |
API level 15, NDK 8 |
| Android 4.1 Jelly Bean (API level 16) |
4.1.x |
Jelly Bean |
API level 16 |
| Android 4.2 Jelly Bean (API level 17) |
4.2.x |
Jelly Bean |
API level 17 |
| Android 4.3 Jelly Bean (API level 18) |
4.3.x |
Jelly Bean |
API level 18 |
| Android 4.4 KitKat (API level 19) |
4.4 |
KitKat |
API level 19 |
對於各個名稱對應的圖片,單獨整理出來,供參考:
舉例說明:
Android開發期間,配置文件中的target或minimal的API level,如果是17,則對應的是4.2.x的Jelly Bean。
Android獲取手機和系統版本等信息的代碼
有時候需要統計手機的型號和版本號,利用程序可以獲取到相應的手機信息,對比兩部手機發現,廠商不同,某個信息顯示方式也不盡相同,具體見:
1 String phoneInfo = "Product: " + android.os.Build.PRODUCT; 2 phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI; 3 phoneInfo += ", TAGS: " + android.os.Build.TAGS; 4 phoneInfo += ", VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE; 5 phoneInfo += ", MODEL: " + android.os.Build.MODEL; 6 phoneInfo += ", SDK: " + android.os.Build.VERSION.SDK; 7 phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE; 8 phoneInfo += ", DEVICE: " + android.os.Build.DEVICE; 9 phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY; 10 phoneInfo += ", BRAND: " + android.os.Build.BRAND; 11 phoneInfo += ", BOARD: " + android.os.Build.BOARD; 12 phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT; 13 phoneInfo += ", ID: " + android.os.Build.ID; 14 phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER; 15 phoneInfo += ", USER: " + android.os.Build.USER; 16 // Toast.makeText(this, phoneInfo, Toast.LENGTH_LONG).show(); 17 TextView t = (TextView) findViewById(R.id.main_phoneinfo); 18 t.setText(phoneInfo);
參考文章:http://www.cnblogs.com/hope250/archive/2011/04/04/2005409.html









