Most visited

Recently visited

Added in API level 4

Build.VERSION_CODES

public static class Build.VERSION_CODES
extends Object

java.lang.Object
   ↳ android.os.Build.VERSION_CODES


枚举当前已知的SDK版本代码。 这些值可以在SDK找到。 版本号随每个官方平台版本单调递增。

Summary

Constants

int BASE

2008年10月:Android的原版,第一版。

int BASE_1_1

2009年2月:首次Android更新,正式名称为1.1。

int CUPCAKE

2009年5月:Android 1.5。

int CUR_DEVELOPMENT

当前开发版本的魔术版本号,尚未变成官方版本。

int DONUT

2009年9月:Android 1.6。

int ECLAIR

2009年11月:Android 2.0

面向此版本或更高版本的应用程序将获得这些行为的新变化:

int ECLAIR_0_1

2009年12月:Android 2.0.1

int ECLAIR_MR1

2010年1月:Android 2.1

int FROYO

2010年6月:Android 2.2

int GINGERBREAD

2010年11月:Android 2.3

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • The application's notification icons will be shown on the new dark status bar background, so must be visible in this situation.

int GINGERBREAD_MR1

2011年2月:Android 2.3.3。

int HONEYCOMB

2011年2月:Android 3.0。

int HONEYCOMB_MR1

2011年5月:Android 3.1。

int HONEYCOMB_MR2

2011年6月:Android 3.2。

int ICE_CREAM_SANDWICH

2011年10月:Android 4.0。

int ICE_CREAM_SANDWICH_MR1

2011年12月:Android 4.0.3。

int JELLY_BEAN

2012年6月:Android 4.1。

int JELLY_BEAN_MR1

2012年11月:Android 4.2,莫阿胶豆!

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • Content Providers: The default value of android:exported is now false.

int JELLY_BEAN_MR2

2013年7月:Android 4.3,报复豆子。

int KITKAT

2013年10月:Android 4.4,KitKat,另一款美味佳肴。

int KITKAT_WATCH

2014年6月:Android 4.4W。

int LOLLIPOP

2014年11月:棒棒糖。

int LOLLIPOP_MR1

2015年3月:在外面加上额外糖衣的棒棒糖!

int M

M是棉花糖!

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • Runtime permissions.

int N

N代表Â'\ _(ビ)_ /Â。

Public constructors

Build.VERSION_CODES()

Inherited methods

From class java.lang.Object

Constants

BASE

Added in API level 4
int BASE

2008年10月:Android的原版,第一版。 好极了!

常数值:1(0x00000001)

BASE_1_1

Added in API level 4
int BASE_1_1

2009年2月:首次Android更新,正式名称为1.1。

常量值:2(0x00000002)

CUPCAKE

Added in API level 4
int CUPCAKE

2009年5月:Android 1.5。

常量值:3(0x00000003)

CUR_DEVELOPMENT

Added in API level 4
int CUR_DEVELOPMENT

当前开发版本的魔术版本号,尚未变成官方版本。

常量值:10000(0x00002710)

DONUT

Added in API level 4
int DONUT

2009年9月:Android 1.6。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • They must explicitly request the WRITE_EXTERNAL_STORAGE permission to be able to modify the contents of the SD card. (Apps targeting earlier versions will always request the permission.)
  • They must explicitly request the READ_PHONE_STATE permission to be able to be able to retrieve phone state info. (Apps targeting earlier versions will always request the permission.)
  • They are assumed to support different screen densities and sizes. (Apps targeting earlier versions are assumed to only support medium density normal size screens unless otherwise indicated). They can still explicitly specify screen support either way with the supports-screens manifest tag.
  • TabHost will use the new dark tab background design.

常量值:4(0x00000004)

ECLAIR

Added in API level 5
int ECLAIR

2009年11月:Android 2.0

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • The Service.onStartCommand function will return the new START_STICKY behavior instead of the old compatibility START_STICKY_COMPATIBILITY.
  • The Activity class will now execute back key presses on the key up instead of key down, to be able to detect canceled presses from virtual keys.
  • The TabWidget class will use a new color scheme for tabs. In the new scheme, the foreground tab has a medium gray background the background tabs have a dark gray background.

常量值:5(0x00000005)

ECLAIR_0_1

Added in API level 6
int ECLAIR_0_1

2009年12月:Android 2.0.1

常数值:6(0x00000006)

ECLAIR_MR1

Added in API level 7
int ECLAIR_MR1

2010年1月:Android 2.1

常量值:7(0x00000007)

FROYO

Added in API level 8
int FROYO

2010年6月:Android 2.2

常量值:8(0x00000008)

GINGERBREAD

Added in API level 9
int GINGERBREAD

2010年11月:Android 2.3

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • The application's notification icons will be shown on the new dark status bar background, so must be visible in this situation.

常量值:9(0x00000009)

GINGERBREAD_MR1

Added in API level 10
int GINGERBREAD_MR1

2011年2月:Android 2.3.3。

常量值:10(0x0000000a)

HONEYCOMB

Added in API level 11
int HONEYCOMB

2011年2月:Android 3.0。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • The default theme for applications is now dark holographic: Theme_Holo.
  • On large screen devices that do not have a physical menu button, the soft (compatibility) menu is disabled.
  • The activity lifecycle has changed slightly as per Activity.
  • An application will crash if it does not call through to the super implementation of its Activity.onPause() method.
  • When an application requires a permission to access one of its components (activity, receiver, service, provider), this permission is no longer enforced when the application wants to access its own component. This means it can require a permission on a component that it does not itself hold and still access that component.
  • Context.getSharedPreferences() will not automatically reload the preferences if they have changed on storage, unless MODE_MULTI_PROCESS is used.
  • setMotionEventSplittingEnabled(boolean) will default to true.
  • FLAG_SPLIT_TOUCH is enabled by default on windows.
  • PopupWindow.isSplitTouchEnabled() will return true by default.
  • GridView and ListView will use View.setActivated for selected items if they do not implement Checkable.
  • Scroller will be constructed with "flywheel" behavior enabled by default.

常量值:11(0x0000000b)

HONEYCOMB_MR1

Added in API level 12
int HONEYCOMB_MR1

2011年5月:Android 3.1。

常量值:12(0x0000000c)

HONEYCOMB_MR2

Added in API level 13
int HONEYCOMB_MR2

2011年6月:Android 3.2。

更新至Honeycomb MR1以支持7英寸平板电脑,改进屏幕兼容模式等。

从这个版本开始,没有说他们是否支持XLARGE屏幕的应用程序只会在HONEYCOMB或更高版本HONEYCOMB ; 它已经是GINGERBREAD或更高版本。 不支持至少与当前屏幕一样大的屏幕尺寸的应用程序将为用户提供UI以将其切换到屏幕尺寸兼容模式。

该版本引入了基于在DP屏幕尺寸新的屏幕大小的资源预选赛:看screenWidthDpscreenHeightDp ,并smallestScreenWidthDp 在<载体的筛选>供给这些按requiresSmallestWidthDpcompatibleWidthLimitDplargestWidthLimitDp优于较老的画面尺寸的桶和用于旧设备的适当的存储桶将从他们推断。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

常量值:13(0x0000000d)

ICE_CREAM_SANDWICH

Added in API level 14
int ICE_CREAM_SANDWICH

2011年10月:Android 4.0。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • For devices without a dedicated menu key, the software compatibility menu key will not be shown even on phones. By targeting Ice Cream Sandwich or later, your UI must always have its own menu UI affordance if needed, on both tablets and phones. The ActionBar will take care of this for you.
  • 2d drawing hardware acceleration is now turned on by default. You can use android:hardwareAccelerated to turn it off if needed, although this is strongly discouraged since it will result in poor performance on larger screen devices.
  • The default theme for applications is now the "device default" theme: Theme_DeviceDefault. This may be the holo dark theme or a different dark theme defined by the specific device. The Theme_Holo family must not be modified for a device to be considered compatible. Applications that explicitly request a theme from the Holo family will be guaranteed that these themes will not change character within the same platform version. Applications that wish to blend in with the device should use a theme from the Theme_DeviceDefault family.
  • Managed cursors can now throw an exception if you directly close the cursor yourself without stopping the management of it; previously failures would be silently ignored.
  • The fadingEdge attribute on views will be ignored (fading edges is no longer a standard part of the UI). A new requiresFadingEdge attribute allows applications to still force fading edges on for special cases.
  • Context.bindService() will not automatically add in BIND_WAIVE_PRIORITY.
  • App Widgets will have standard padding automatically added around them, rather than relying on the padding being baked into the widget itself.
  • An exception will be thrown if you try to change the type of a window after it has been added to the window manager. Previously this would result in random incorrect behavior.
  • AnimationSet will parse out the duration, fillBefore, fillAfter, repeatMode, and startOffset XML attributes that are defined.
  • ActionBar.setHomeButtonEnabled() is false by default.

常量值:14(0x0000000e)

ICE_CREAM_SANDWICH_MR1

Added in API level 15
int ICE_CREAM_SANDWICH_MR1

2011年12月:Android 4.0.3。

常量值:15(0x0000000f)

JELLY_BEAN

Added in API level 16
int JELLY_BEAN

2012年6月:Android 4.1。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

常量值:16(0x00000010)

JELLY_BEAN_MR1

Added in API level 17
int JELLY_BEAN_MR1

2012年11月:Android 4.2,莫阿胶豆!

面向此版本或更高版本的应用程序将获得这些行为的新变化:

常量值:17(0x00000011)

JELLY_BEAN_MR2

Added in API level 18
int JELLY_BEAN_MR2

2013年7月:Android 4.3,报复豆子。

常量值:18(0x00000012)

KITKAT

Added in API level 19
int KITKAT

2013年10月:Android 4.4,KitKat,另一款美味佳肴。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • The default result of PreferenceActivity.isValueFragment becomes false instead of true.
  • In WebView, apps targeting earlier versions will have JS URLs evaluated directly and any result of the evaluation will not replace the current page content. Apps targetting KITKAT or later that load a JS URL will have the result of that URL replace the content of the current page
  • AlarmManager.set becomes interpreted as an inexact value, to give the system more flexibility in scheduling alarms.
  • Context.getSharedPreferences no longer allows a null name.
  • RelativeLayout changes to compute wrapped content margins correctly.
  • ActionBar's window content overlay is allowed to be drawn.
  • The READ_EXTERNAL_STORAGE permission is now always enforced.
  • Access to package-specific external storage directories belonging to the calling app no longer requires the READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permissions.

常量值:19(0x00000013)

KITKAT_WATCH

Added in API level 20
int KITKAT_WATCH

2014年6月:Android 4.4W。 用于手表的KitKat,即食小吃。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • AlertDialog might not have a default background if the theme does not specify one.

常量值:20(0x00000014)

LOLLIPOP

Added in API level 21
int LOLLIPOP

2014年11月:棒棒糖。 一个美丽的阴影平坦的一个。 但仍然美味。

面向此版本或更高版本的应用程序将获得这些行为的新变化:

  • Context.bindService now requires an explicit Intent, and will throw an exception if given an implicit Intent.
  • Notification.Builder will not have the colors of their various notification elements adjusted to better match the new material design look.
  • Message will validate that a message is not currently in use when it is recycled.
  • Hardware accelerated drawing in windows will be enabled automatically in most places.
  • Spinner throws an exception if attaching an adapter with more than one item type.
  • If the app is a launcher, the launcher will be available to the user even when they are using corporate profiles (which requires that the app use LauncherApps to correctly populate its apps UI).
  • Calling Service.stopForeground with removeNotification false will modify the still posted notification so that it is no longer forced to be ongoing.
  • A DreamService must require the BIND_DREAM_SERVICE permission to be usable.

常量值:21(0x00000015)

LOLLIPOP_MR1

Added in API level 22
int LOLLIPOP_MR1

2015年3月:在外面加上额外糖衣的棒棒糖!

常量值:22(0x00000016)

M

Added in API level 23
int M

M是棉花糖!

面向此版本或更高版本的应用程序将获得这些行为的新变化:

常量值:23(0x00000017)

N

Added in API level 24
int N

N代表Â'\ _(ビ)_ /Â。

常量值:24(0x00000018)

Public constructors

Build.VERSION_CODES

Added in API level 4
Build.VERSION_CODES ()

Hooray!