to top
Android APIs
public static class

Build.VERSION_CODES

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

Class Overview

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

Summary

Constants
int BASE October 2008: The original, first, version of Android.
int BASE_1_1 February 2009: First Android update, officially called 1.1.
int CUPCAKE May 2009: Android 1.5.
int CUR_DEVELOPMENT Magic version number for a current development build, which has not yet turned into an official release.
int DONUT September 2009: Android 1.6.
int ECLAIR November 2009: Android 2.0

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

int ECLAIR_0_1 December 2009: Android 2.0.1
int ECLAIR_MR1 January 2010: Android 2.1
int FROYO June 2010: Android 2.2
int GINGERBREAD November 2010: Android 2.3

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.
int GINGERBREAD_MR1 February 2011: Android 2.3.3.
int HONEYCOMB February 2011: Android 3.0.
int HONEYCOMB_MR1 May 2011: Android 3.1.
int HONEYCOMB_MR2 June 2011: Android 3.2.
int ICE_CREAM_SANDWICH October 2011: Android 4.0.
int ICE_CREAM_SANDWICH_MR1 December 2011: Android 4.0.3.
int JELLY_BEAN Android 4.1.
Public Constructors
Build.VERSION_CODES()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int BASE

Since: API Level 4

October 2008: The original, first, version of Android. Yay!

Constant Value: 1 (0x00000001)

public static final int BASE_1_1

Since: API Level 4

February 2009: First Android update, officially called 1.1.

Constant Value: 2 (0x00000002)

public static final int CUPCAKE

Since: API Level 4

May 2009: Android 1.5.

Constant Value: 3 (0x00000003)

public static final int CUR_DEVELOPMENT

Since: API Level 4

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

Constant Value: 10000 (0x00002710)

public static final int DONUT

Since: API Level 4

September 2009: Android 1.6.

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

  • 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.

Constant Value: 4 (0x00000004)

public static final int ECLAIR

Since: API Level 5

November 2009: Android 2.0

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

  • 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.

Constant Value: 5 (0x00000005)

public static final int ECLAIR_0_1

Since: API Level 6

December 2009: Android 2.0.1

Constant Value: 6 (0x00000006)

public static final int ECLAIR_MR1

Since: API Level 7

January 2010: Android 2.1

Constant Value: 7 (0x00000007)

public static final int FROYO

Since: API Level 8

June 2010: Android 2.2

Constant Value: 8 (0x00000008)

public static final int GINGERBREAD

Since: API Level 9

November 2010: Android 2.3

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)

public static final int GINGERBREAD_MR1

Since: API Level 10

February 2011: Android 2.3.3.

Constant Value: 10 (0x0000000a)

public static final int HONEYCOMB

Since: API Level 11

February 2011: Android 3.0.

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

  • 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.

Constant Value: 11 (0x0000000b)

public static final int HONEYCOMB_MR1

Since: API Level 12

May 2011: Android 3.1.

Constant Value: 12 (0x0000000c)

public static final int HONEYCOMB_MR2

Since: API Level 13

June 2011: Android 3.2.

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 screenWidthDp, screenHeightDp, and smallestScreenWidthDp. Supplying these in <supports-screens> as per requiresSmallestWidthDp, compatibleWidthLimitDp, and 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)

public static final int ICE_CREAM_SANDWICH

Since: API Level 14

October 2011: Android 4.0.

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: 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.

Constant Value: 14 (0x0000000e)

public static final int ICE_CREAM_SANDWICH_MR1

Since: API Level 15

December 2011: Android 4.0.3.

Constant Value: 15 (0x0000000f)

public static final int JELLY_BEAN

Since: API Level 16

Android 4.1.

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

Constant Value: 16 (0x00000010)

Public Constructors

public Build.VERSION_CODES ()

Since: API Level 4