Android 版本動態判斷

來源:互聯網
上載者:User
[代碼] [Java]代碼
1 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
2      //TODO:如果目前的版本小於HONEYCOMB版本,即3.0版本
3 }
[代碼] Build.VERSION_CODES類下面的版本資訊view sourceprint?
01 Constants
02 int BASE    October
2008: The original, first, version of Android.
03 int BASE_1_1    February
2009: First Android update, officially called
1.1.
04 int CUPCAKE May
2009: Android 1.5.
05 int CUR_DEVELOPMENT Magic version number
for a current development build, which has not yet turned into an official release.
06 int DONUT   September
2009: Android 1.6.
07 int ECLAIR  November
2009: Android 2.0
08 Applications targeting this
or a later release will get these new
changes in behavior:
09  
10 The Service.onStartCommand function will
return the new
START_STICKY behavior instead of the old compatibility START_STICKY_COMPATIBILITY.
11 int ECLAIR_0_1  December
2009: Android 2.0.1
12 int ECLAIR_MR1  January
2010: Android 2.1
13 int FROYO   June
2010: Android 2.2
14 int GINGERBREAD November
2010: Android 2.3
15 Applications targeting this
or a later release will get these new
changes in behavior:
16  
17 The application's notification icons will be shown on the
new dark status bar background, so must be visible in
this situation.
18 int GINGERBREAD_MR1 February
2011: Android 2.3.3.
19 int HONEYCOMB   February
2011: Android 3.0.
20 int HONEYCOMB_MR1   May
2011: Android 3.1.
21 int HONEYCOMB_MR2   June
2011: Android 3.2.
22 int ICE_CREAM_SANDWICH  October
2011: Android 4.0.
23 int ICE_CREAM_SANDWICH_MR1  December
2011: Android 4.0.3.
24 int JELLY_BEAN  Android
4.1.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.