Build.VERSION_CODES

public static class Build.VERSION_CODES
extends Object

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


Enumeration of the currently known SDK version codes. These are the values that can be found in VERSION#SDK. Version numbers increment monotonically with each official platform release.

Summary

Constants

int BASE

The original, first, version of Android.

int BASE_1_1

First Android update.

int CUPCAKE

C.

int CUR_DEVELOPMENT

Magic version number for a current development build, which has not yet turned into an official release.

int DONUT

D.

int ECLAIR

E.

int ECLAIR_0_1

E incremental update.

int ECLAIR_MR1

E MR1.

int FROYO

F.

int GINGERBREAD

G.

int GINGERBREAD_MR1

G MR1.

int HONEYCOMB

H.

int HONEYCOMB_MR1

H MR1.

int HONEYCOMB_MR2

H MR2.

int ICE_CREAM_SANDWICH

I.

int ICE_CREAM_SANDWICH_MR1

I MR1.

int JELLY_BEAN

J.

int JELLY_BEAN_MR1

J MR1.

int JELLY_BEAN_MR2

J MR2.

int KITKAT

K.

int KITKAT_WATCH

K for watches.

int LOLLIPOP

L.

int LOLLIPOP_MR1

L MR1.

int M

M.

int N

N.

int N_MR1

N MR1.

int O

O.

int O_MR1

O MR1.

int P

P.

int Q

Q.

int R

R.

int S

S.

int S_V2

S V2.

int TIRAMISU

Tiramisu.

int UPSIDE_DOWN_CAKE

Upside Down Cake.

Public constructors

VERSION_CODES()

Inherited methods

Constants

BASE

Added in API level 4
public static final int BASE

The original, first, version of Android. Yay!

Released publicly as Android 1.0 in September 2008.

Constant Value: 1 (0x00000001)

BASE_1_1

Added in API level 4
public static final int BASE_1_1

First Android update.

Released publicly as Android 1.1 in February 2009.

Constant Value: 2 (0x00000002)

CUPCAKE

Added in API level 4
public static final int CUPCAKE

C.

Released publicly as Android 1.5 in April 2009.

Constant Value: 3 (0x00000003)

CUR_DEVELOPMENT

Added in API level 4
public static final int CUR_DEVELOPMENT

Magic version number for a current development build, which has not yet turned into an official release.

Constant Value: 10000 (0x00002710)

DONUT

Added in API level 4
public static final int DONUT

D.

Released publicly as Android 1.6 in September 2009.

Applications targeting this or a later release will get these new changes in behavior:

  • They must explicitly request the Manifest.permission.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 Manifest.permission.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.

Constant Value: 4 (0x00000004)

ECLAIR

Added in API level 5
public static final int ECLAIR

E.

Released publicly as Android 2.0 in October 2009.

Applications targeting this or a later release will get these new changes in behavior:

  • The Service.onStartCommand function will return the new Service.START_STICKY behavior instead of the old compatibility Service.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.

Constant Value: 5 (0x00000005)

ECLAIR_0_1

Added in API level 6
public static final int ECLAIR_0_1

E incremental update.

Released publicly as Android 2.0.1 in December 2009.

Constant Value: 6 (0x00000006)

ECLAIR_MR1

Added in API level 7
public static final int ECLAIR_MR1

E MR1.

Released publicly as Android 2.1 in January 2010.

Constant Value: 7 (0x00000007)

FROYO

Added in API level 8
public static final int FROYO

F.

Released publicly as Android 2.2 in May 2010.

Constant Value: 8 (0x00000008)

GINGERBREAD

Added in API level 9
public static final int GINGERBREAD

G.

Released publicly as Android 2.3 in December 2010.

Applications targeting this or a later release will get these new changes in behavior:

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

Constant Value: 9 (0x00000009)

GINGERBREAD_MR1

Added in API level 10
public static final int GINGERBREAD_MR1

G MR1.

Released publicly as Android 2.3.3 in February 2011.

Constant Value: 10 (0x0000000a)

HONEYCOMB

Added in API level 11
public static final int HONEYCOMB

H.

Released publicly as Android 3.0 in February 2011.

Applications targeting this or a later release will get these new changes in behavior:

Constant Value: 11 (0x0000000b)

HONEYCOMB_MR1

Added in API level 12
public static final int HONEYCOMB_MR1

H MR1.

Released publicly as Android 3.1 in May 2011.

Constant Value: 12 (0x0000000c)

HONEYCOMB_MR2

Added in API level 13
public static final int HONEYCOMB_MR2

H MR2.

Released publicly as Android 3.2 in July 2011.

Update to Honeycomb MR1 to support 7 inch tablets, improve screen compatibility mode, etc.

As of this version, applications that don't say whether they support XLARGE screens will be assumed to do so only if they target HONEYCOMB or later; it had been GINGERBREAD or later. Applications that don't support a screen size at least as large as the current screen will provide the user with a UI to switch them in to screen size compatibility mode.

This version introduces new screen size resource qualifiers based on the screen size in dp: see Configuration.screenWidthDp, Configuration.screenHeightDp, and Configuration.smallestScreenWidthDp. Supplying these in <supports-screens> as per ApplicationInfo.requiresSmallestWidthDp, ApplicationInfo.compatibleWidthLimitDp, and ApplicationInfo.largestWidthLimitDp is preferred over the older screen size buckets and for older devices the appropriate buckets will be inferred from them.

Applications targeting this or a later release will get these new changes in behavior:

Constant Value: 13 (0x0000000d)

ICE_CREAM_SANDWICH

Added in API level 14
public static final int ICE_CREAM_SANDWICH

I.

Released publicly as Android 4.0 in October 2011.

Applications targeting this or a later release will get these new changes in behavior:

  • 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: R.style.Theme_DeviceDefault. This may be the holo dark theme or a different dark theme defined by the specific device. The R.style.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 R.style.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 Context.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.

Constant Value: 14 (0x0000000e)

ICE_CREAM_SANDWICH_MR1

Added in API level 15
public static final int ICE_CREAM_SANDWICH_MR1

I MR1.

Released publicly as Android 4.03 in December 2011.

Constant Value: 15 (0x0000000f)

JELLY_BEAN

Added in API level 16
public static final int JELLY_BEAN

J.

Released publicly as Android 4.1 in July 2012.

Applications targeting this or a later release will get these new changes in behavior:

Constant Value: 16 (0x00000010)

JELLY_BEAN_MR1

Added in API level 17
public static final int JELLY_BEAN_MR1

J MR1.

Released publicly as Android 4.2 in November 2012.

Applications targeting this or a later release will get these new changes in behavior:

Constant Value: 17 (0x00000011)

JELLY_BEAN_MR2

Added in API level 18
public static final int JELLY_BEAN_MR2

J MR2.

Released publicly as Android 4.3 in July 2013.

Constant Value: 18 (0x00000012)

KITKAT

Added in API level 19
public static final int KITKAT

K.

Released publicly as Android 4.4 in October 2013.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android KitKat overview.

Constant Value: 19 (0x00000013)

KITKAT_WATCH

Added in API level 20
public static final int KITKAT_WATCH

K for watches.

Released publicly as Android 4.4W in June 2014.

Applications targeting this or a later release will get these new changes in behavior:

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

Constant Value: 20 (0x00000014)

LOLLIPOP

Added in API level 21
public static final int LOLLIPOP

L.

Released publicly as Android 5.0 in November 2014.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android Lollipop overview.

  • 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 Manifest.permission.BIND_DREAM_SERVICE permission to be usable.

Constant Value: 21 (0x00000015)

LOLLIPOP_MR1

Added in API level 22
public static final int LOLLIPOP_MR1

L MR1.

Released publicly as Android 5.1 in March 2015.

For more information about this release, see the Android 5.1 APIs.

Constant Value: 22 (0x00000016)

M

Added in API level 23
public static final int M

M.

Released publicly as Android 6.0 in October 2015.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android 6.0 Marshmallow overview.

Constant Value: 23 (0x00000017)

N

Added in API level 24
public static final int N

N.

Released publicly as Android 7.0 in August 2016.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android Nougat overview.

Constant Value: 24 (0x00000018)

N_MR1

Added in API level 25
public static final int N_MR1

N MR1.

Released publicly as Android 7.1 in October 2016.

For more information about this release, see Android 7.1 for Developers.

Constant Value: 25 (0x00000019)

O

Added in API level 26
public static final int O

O.

Released publicly as Android 8.0 in August 2017.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android Oreo overview.

Constant Value: 26 (0x0000001a)

O_MR1

Added in API level 27
public static final int O_MR1

O MR1.

Released publicly as Android 8.1 in December 2017.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see Android 8.1 features and APIs.

  • Apps exporting and linking to apk shared libraries must explicitly enumerate all signing certificates in a consistent order.
  • R.attr.screenOrientation can not be used to request a fixed orientation if the associated activity is not fullscreen and opaque.

Constant Value: 27 (0x0000001b)

P

Added in API level 28
public static final int P

P.

Released publicly as Android 9 in August 2018.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android 9 Pie overview.

Constant Value: 28 (0x0000001c)

Q

Added in API level 29
public static final int Q

Q.

Released publicly as Android 10 in September 2019.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android 10 overview.

Constant Value: 29 (0x0000001d)

R

Added in API level 30
public static final int R

R.

Released publicly as Android 11 in September 2020.

Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android 11 overview.

Constant Value: 30 (0x0000001e)

S

Added in API level 31
public static final int S

S.

Constant Value: 31 (0x0000001f)

S_V2

Added in API level 32
public static final int S_V2

S V2. Once more unto the breach, dear friends, once more.

Constant Value: 32 (0x00000020)

TIRAMISU

Added in API level 33
public static final int TIRAMISU

Tiramisu.

Constant Value: 33 (0x00000021)

UPSIDE_DOWN_CAKE

Added in API level 34
public static final int UPSIDE_DOWN_CAKE

Upside Down Cake.

Constant Value: 34 (0x00000022)

Public constructors

VERSION_CODES

public VERSION_CODES ()