一.由于涉及到版权问题,从2009年5月开始,Android操作系统改用甜点来作为版本代号,这些版本按照大写字母的顺序来进行命名
Android 1.0 (没有开发代号) - - API1
- - - BASE
Android 1.1 - Petit Four - - API2
- - - BASE_1_1
Android 1.5 - Cupcake - 纸杯蛋糕 - - API3
- - - CUPCAKE
Android 1.6 - Donut - 甜甜圈 - - API4
- - - DONUT
Android 2.0 - Éclair - 闪电泡芙/法式奶油夹心甜点/松饼 - - API5
- - - ECLAIR
Android 2.0.1 - Éclair - 闪电泡芙/法式奶油夹心甜点/松饼 - - API6
- - - ECLAIR_0_1
Android 2.1 - Éclair - 闪电泡芙/法式奶油夹心甜点/松饼 - - API7
- - - ECLAIR_MR1
Android 2.2 - Froyo - 冻酸奶 - - API8
- - - FROYO
Android 2.3/2.3.2 - Gingerbread - 姜饼 - - API9
- - - GINGERBREAD
Android 2.3.3/2.3.7 - Gingerbread - 姜饼 - - API10
- - - GINGERBREAD_MR1
Android 3.0 - Honeycomb - 蜂巢 - - API11
- - - HONEYCOMB
Android 3.1 - Honeycomb - 蜂巢 - - API12
- - - HONEYCOMB_MR1
Android 3.2 - Honeycomb - 蜂巢 - - API13
- - - HONEYCOMB_MR2
Android 4.0/4.0.2 - Ice Cream Sandwich - 冰激凌三明治 - - API14
- - - ICE_CREAM_SANDWICH
Android 4.0.3/4.0.4 - Ice Cream Sandwich - 冰激凌三明治 - - API15
- - - ICE_CREAM_SANDWICH_MR1
Android 4.1 - Jelly Bean - 果冻豆 - - API16
- - - JELLY_BEAN
Android 4.2 - Jelly Bean - 果冻豆 - - API17
- - - JELLY_BEAN_MR1
Android 4.3 - Jelly Bean - 果冻豆 - - API18
- - - JELLY_BEAN_MR2
Android 4.4 - KitKat - 奇巧巧克力棒 - - API19
- - - KITKAT
Android 4.4W - KitKat - 奇巧巧克力棒 - - API20
- - - KITKAT_WATCH
Android 5.0 - Lollipop(Android L) - 棒棒糖 - - API21
- - - LOLLIPOP
Android 5.1 - Lollipop(Android L) - 棒棒糖 - - API22
- - - LOLLIPOP_MR1
Android 6.0 - Marshmallow(Android M) - 棉花糖 - - API23
- - - M
Android 7.0 - Nougat(Android N) - 牛轧糖 - - API24
- - - 暂无
二.代码中判断版本
当前版本:
Build.VERSION.SDK_INTAndroid版本:
Build.VERSION_CODES.~