VERSION_CODES
open class VERSION_CODES
kotlin.Any | |
↳ | 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 | |
---|---|
static Int |
Baklava. |
static Int |
The original, first, version of Android. |
static Int |
First Android update. |
static Int |
C. |
static Int |
Magic version number for a current development build, which has not yet turned into an official release. |
static Int |
D. |
static Int |
E. |
static Int |
E incremental update. |
static Int |
E MR1. |
static Int |
F. |
static Int |
G. |
static Int |
G MR1. |
static Int |
H. |
static Int |
H MR1. |
static Int |
H MR2. |
static Int |
I. |
static Int |
I MR1. |
static Int |
J. |
static Int |
J MR1. |
static Int |
J MR2. |
static Int |
K. |
static Int |
K for watches. |
static Int |
L. |
static Int |
L MR1. |
static Int |
M. |
static Int |
N. |
static Int |
N MR1. |
static Int |
O. |
static Int |
O MR1. |
static Int |
P. |
static Int |
Q. |
static Int |
R. |
static Int |
S. |
static Int |
S V2. |
static Int |
Tiramisu. |
static Int |
Upside Down Cake. |
static Int |
Vanilla Ice Cream. |
Public constructors | |
---|---|
Constants
BASE
static val BASE: Int
The original, first, version of Android. Yay!
Released publicly as Android 1.0 in September 2008.
Value: 1
BASE_1_1
static val BASE_1_1: Int
First Android update.
Released publicly as Android 1.1 in February 2009.
Value: 2
CUPCAKE
static val CUPCAKE: Int
C.
Released publicly as Android 1.5 in April 2009.
Value: 3
CUR_DEVELOPMENT
static val CUR_DEVELOPMENT: Int
Magic version number for a current development build, which has not yet turned into an official release.
Value: 10000
DONUT
static val DONUT: Int
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
android.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
android.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.
-
android.widget.TabHost
will use the new dark tab background design.
Value: 4
ECLAIR
static val ECLAIR: Int
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 newandroid.app.Service#START_STICKY
behavior instead of the old compatibilityandroid.app.Service#START_STICKY_COMPATIBILITY
. - The
android.app.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
android.widget.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.
Value: 5
ECLAIR_0_1
static val ECLAIR_0_1: Int
E incremental update.
Released publicly as Android 2.0.1 in December 2009.
Value: 6
ECLAIR_MR1
static val ECLAIR_MR1: Int
E MR1.
Released publicly as Android 2.1 in January 2010.
Value: 7
FROYO
static val FROYO: Int
F.
Released publicly as Android 2.2 in May 2010.
Value: 8
GINGERBREAD
static val GINGERBREAD: Int
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.
Value: 9
GINGERBREAD_MR1
static val GINGERBREAD_MR1: Int
G MR1.
Released publicly as Android 2.3.3 in February 2011.
Value: 10
HONEYCOMB
static val HONEYCOMB: Int
H.
Released publicly as Android 3.0 in February 2011.
Applications targeting this or a later release will get these new changes in behavior:
- The default theme for applications is now dark holographic:
android.R.style#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
android.app.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, unlessandroid.content.Context#MODE_MULTI_PROCESS
is used. -
android.view.ViewGroup#setMotionEventSplittingEnabled
will default to true. -
android.view.WindowManager.LayoutParams#FLAG_SPLIT_TOUCH
is enabled by default on windows. -
PopupWindow.isSplitTouchEnabled()
will return true by default. -
android.widget.GridView
andandroid.widget.ListView
will useView.setActivated
for selected items if they do not implementandroid.widget.Checkable
. -
android.widget.Scroller
will be constructed with "flywheel" behavior enabled by default.
Value: 11
HONEYCOMB_MR1
static val HONEYCOMB_MR1: Int
H MR1.
Released publicly as Android 3.1 in May 2011.
Value: 12
HONEYCOMB_MR2
static val HONEYCOMB_MR2: Int
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 android.content.res.Configuration#screenWidthDp
, android.content.res.Configuration#screenHeightDp
, and android.content.res.Configuration#smallestScreenWidthDp
. Supplying these in <supports-screens> as per android.content.pm.ApplicationInfo#requiresSmallestWidthDp
, android.content.pm.ApplicationInfo#compatibleWidthLimitDp
, and android.content.pm.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:
-
New
android.content.pm.PackageManager#FEATURE_SCREEN_PORTRAIT
andandroid.content.pm.PackageManager#FEATURE_SCREEN_LANDSCAPE
features were introduced in this release. Applications that target previous platform versions are assumed to require both portrait and landscape support in the device; when targeting Honeycomb MR1 or greater the application is responsible for specifying any specific orientation it requires. -
android.os.AsyncTask
will use the serial executor by default when calling android.os.AsyncTask#execute. ActivityInfo.configChanges
will have theandroid.content.pm.ActivityInfo#CONFIG_SCREEN_SIZE
andandroid.content.pm.ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE
bits set; these need to be cleared for older applications because some developers have done absolute comparisons against this value instead of correctly masking the bits they are interested in.
Value: 13
ICE_CREAM_SANDWICH
static val ICE_CREAM_SANDWICH: Int
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:
android.R.style#Theme_DeviceDefault
. This may be the holo dark theme or a different dark theme defined by the specific device. Theandroid.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 theandroid.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.
- android.content.Context#bindService will not automatically add in
android.content.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.
-
android.view.animation.AnimationSet
will parse out the duration, fillBefore, fillAfter, repeatMode, and startOffset XML attributes that are defined. -
ActionBar.setHomeButtonEnabled()
is false by default.
Value: 14
ICE_CREAM_SANDWICH_MR1
static val ICE_CREAM_SANDWICH_MR1: Int
I MR1.
Released publicly as Android 4.03 in December 2011.
Value: 15
JELLY_BEAN
static val JELLY_BEAN: Int
J.
Released publicly as Android 4.1 in July 2012.
Applications targeting this or a later release will get these new changes in behavior:
- You must explicitly request the
android.Manifest.permission#READ_CALL_LOG
and/orandroid.Manifest.permission#WRITE_CALL_LOG
permissions; access to the call log is no longer implicitly provided throughandroid.Manifest.permission#READ_CONTACTS
andandroid.Manifest.permission#WRITE_CONTACTS
. -
android.widget.RemoteViews
will throw an exception if setting an onClick handler for views being generated by aandroid.widget.RemoteViewsService
for a collection container; previously this just resulted in a warning log message. - New
android.app.ActionBar
policy for embedded tabs: embedded tabs are now always stacked in the action bar when in portrait mode, regardless of the size of the screen. -
WebSettings.setAllowFileAccessFromFileURLs
andWebSettings.setAllowUniversalAccessFromFileURLs
default to false. - Calls to
PackageManager.setComponentEnabledSetting
will now throw an IllegalArgumentException if the given component class name does not exist in the application's manifest. -
NfcAdapter.setNdefPushMessage
,NfcAdapter.setNdefPushMessageCallback
andNfcAdapter.setOnNdefPushCompleteCallback
will throw IllegalStateException if called after the Activity has been destroyed. - Accessibility services must require the new
android.Manifest.permission#BIND_ACCESSIBILITY_SERVICE
permission or they will not be available for use. -
AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS
must be set for unimportant views to be included in queries.
Value: 16
JELLY_BEAN_MR1
static val JELLY_BEAN_MR1: Int
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:
- Content Providers: The default value of
android:exported
is nowfalse
. See the android:exported section in the provider documentation for more details. View.getLayoutDirection()
can return different values thanandroid.view.View#LAYOUT_DIRECTION_LTR
based on the locale etc.-
WebView.addJavascriptInterface
requires explicit annotations on methods for them to be accessible from Javascript.
Value: 17
JELLY_BEAN_MR2
static val JELLY_BEAN_MR2: Int
J MR2.
Released publicly as Android 4.3 in July 2013.
Value: 18
KITKAT
static val KITKAT: Int
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.
- The default result of
PreferenceActivity.isValueFragment
becomes false instead of true. - In
android.webkit.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 - android.app.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. -
android.widget.RelativeLayout
changes to compute wrapped content margins correctly. -
android.app.ActionBar
's window content overlay is allowed to be drawn. - The
android.Manifest.permission#READ_EXTERNAL_STORAGE
permission is now always enforced. - Access to package-specific external storage directories belonging to the calling app no longer requires the
android.Manifest.permission#READ_EXTERNAL_STORAGE
orandroid.Manifest.permission#WRITE_EXTERNAL_STORAGE
permissions.
Value: 19
KITKAT_WATCH
static val KITKAT_WATCH: Int
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:
android.app.AlertDialog
might not have a default background if the theme does not specify one.
Value: 20
LOLLIPOP
static val LOLLIPOP: Int
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.
- android.content.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. -
android.os.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.
-
android.widget.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
android.content.pm.LauncherApps
to correctly populate its apps UI). - Calling android.app.Service#stopForeground with removeNotification false will modify the still posted notification so that it is no longer forced to be ongoing.
- A
android.service.dreams.DreamService
must require theandroid.Manifest.permission#BIND_DREAM_SERVICE
permission to be usable.
Value: 21
LOLLIPOP_MR1
static val LOLLIPOP_MR1: Int
L MR1.
Released publicly as Android 5.1 in March 2015.
For more information about this release, see the Android 5.1 APIs.
Value: 22
M
static val M: Int
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.
- Runtime permissions. Dangerous permissions are no longer granted at install time, but must be requested by the application at runtime through android.app.Activity#requestPermissions.
- Bluetooth and Wi-Fi scanning now requires holding the location permission.
-
AlarmManager.setTimeZone
will fail if the given timezone is non-Olson. - Activity transitions will only return shared elements mapped in the returned view hierarchy back to the calling activity.
-
android.view.View
allows a number of behaviors that may break existing apps: Canvas throws an exception if restore() is called too many times, widgets may return a hint size when returning UNSPECIFIED measure specs, and it will respect the attributesandroid.R.attr#foreground
,android.R.attr#foregroundGravity
,android.R.attr#foregroundTint
, andandroid.R.attr#foregroundTintMode
. -
MotionEvent.getButtonState
will no longer reportandroid.view.MotionEvent#BUTTON_PRIMARY
andandroid.view.MotionEvent#BUTTON_SECONDARY
as synonyms forandroid.view.MotionEvent#BUTTON_STYLUS_PRIMARY
andandroid.view.MotionEvent#BUTTON_STYLUS_SECONDARY
. -
android.widget.ScrollView
now respects the layout param margins when measuring.
Value: 23
N
static val N: Int
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.
-
DownloadManager.Request.setAllowedNetworkTypes
will disable "allow over metered" when specifying onlyandroid.app.DownloadManager.Request#NETWORK_WIFI
. -
android.app.DownloadManager
no longer allows access to raw file paths. -
Notification.Builder.setShowWhen
must be called explicitly to have the time shown, and various other changes inNotification.Builder
to how notifications are shown. android.content.Context#MODE_WORLD_READABLE
andandroid.content.Context#MODE_WORLD_WRITEABLE
are no longer supported.android.os.FileUriExposedException
will be thrown to applications.- Applications will see global drag and drops as per
android.view.View#DRAG_FLAG_GLOBAL
. WebView.evaluateJavascript
will not persist state from an empty WebView.android.animation.AnimatorSet
will not ignore calls to end() before start().AlarmManager.cancel
will throw a NullPointerException if given a null operation.android.app.FragmentManager
will ensure fragments have been created before being placed on the back stack.android.app.FragmentManager
restores fragments inFragment.onCreate
rather than after the method returns.android.R.attr#resizeableActivity
defaults to true.android.graphics.drawable.AnimatedVectorDrawable
throws exceptions when opening invalid VectorDrawable animations.android.view.ViewGroup.MarginLayoutParams
will no longer be dropped when converting between some types of layout params (such asLinearLayout.LayoutParams
toRelativeLayout.LayoutParams
).- Your application processes will not be killed when the device density changes.
- Drag and drop. After a view receives the
android.view.DragEvent#ACTION_DRAG_ENTERED
event, when the drag shadow moves into a descendant view that can accept the data, the view receives theandroid.view.DragEvent#ACTION_DRAG_EXITED
event and won’t receiveandroid.view.DragEvent#ACTION_DRAG_LOCATION
andandroid.view.DragEvent#ACTION_DROP
events while the drag shadow is within that descendant view, even if the descendant view returnsfalse
from its handler for these events.
Value: 24
N_MR1
static val N_MR1: Int
N MR1.
Released publicly as Android 7.1 in October 2016.
For more information about this release, see Android 7.1 for Developers.
Value: 25
O
static val O: Int
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.
- Background execution limits are applied to the application.
- The behavior of AccountManager's
android.accounts.AccountManager#getAccountsByType
,android.accounts.AccountManager#getAccountsByTypeAndFeatures
, andandroid.accounts.AccountManager#hasFeatures
has changed as documented there. android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE_PRE_26
is now returned asandroid.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE
.- The
android.app.NotificationManager
now requires the use of notification channels. - Changes to the strict mode that are set in
Application.onCreate
will no longer be clobbered after that function returns. - A shared library apk with native code will have that native code included in the library path of its clients.
Context.getSharedPreferences
in credential encrypted storage will throw an exception before the user is unlocked.- Attempting to retrieve a
Context.FINGERPRINT_SERVICE
on a device that does not support that feature will now throw a runtime exception. android.app.Fragment
will stop any active view animations when the fragment is stopped.- Some compatibility code in Resources that attempts to use the default Theme the app may be using will be turned off, requiring the app to explicitly request resources with the right theme.
- android.content.ContentResolver#notifyChange and
ContentResolver.registerContentObserver
will throw a SecurityException if the caller does not have permission to access the provider (or the provider doesn't exit); otherwise the call will be silently ignored. - android.hardware.camera2.CameraDevice#createCaptureRequest will enable
android.hardware.camera2.CaptureRequest#CONTROL_ENABLE_ZSL
by default for still image capture. - WallpaperManager's
android.app.WallpaperManager#getWallpaperFile
, android.app.WallpaperManager#getDrawable, android.app.WallpaperManager#getFastDrawable, android.app.WallpaperManager#peekDrawable, and android.app.WallpaperManager#peekFastDrawable will throw an exception if you can not access the wallpaper. - The behavior of android.hardware.usb.UsbDeviceConnection#requestWait is modified as per the documentation there.
StrictMode.VmPolicy.Builder.detectAll
will also enableStrictMode.VmPolicy.Builder.detectContentUriWithoutPermission
andStrictMode.VmPolicy.Builder.detectUntaggedSockets
.StrictMode.ThreadPolicy.Builder.detectAll
will also enableStrictMode.ThreadPolicy.Builder.detectUnbufferedIo
.android.provider.DocumentsContract
's various methods will throw failure exceptions back to the caller instead of returning null.View.hasFocusable
now includes auto-focusable views.android.view.SurfaceView
will no longer always change the underlying Surface object when something about it changes; apps need to look at the current state of the object to determine which things they are interested in have changed.android.view.WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY
must be used for overlay windows, other system overlay window types are not allowed.ViewTreeObserver.addOnDrawListener
will throw an exception if called from within onDraw.Canvas.setBitmap
will no longer preserve the current matrix and clip stack of the canvas.ListPopupWindow.setHeight
will throw an exception if a negative height is supplied.android.widget.TextView
will use internationalized input for numbers, dates, and times.android.widget.Toast
must be used for showing toast windows; the toast window type can not be directly used.WifiManager.getConnectionInfo
requires that the caller hold the location permission to return BSSID/SSIDWifiP2pManager.requestPeers
requires the caller hold the location permission.android.R.attr#maxAspectRatio
defaults to 0, meaning there is no restriction on the app's maximum aspect ratio (so it can be stretched to fill larger screens).android.R.attr#focusable
defaults to a new state (auto
) where it will inherit the value ofandroid.R.attr#clickable
unless explicitly overridden.- A default theme-appropriate focus-state highlight will be supplied to all Views which don't provide a focus-state drawable themselves. This can be disabled by setting
android.R.attr#defaultFocusHighlightEnabled
to false.
Value: 26
O_MR1
static val O_MR1: Int
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.
android.R.attr#screenOrientation
can not be used to request a fixed orientation if the associated activity is not fullscreen and opaque.
Value: 27
P
static val P: Int
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.
- android.app.Service#startForeground requires that apps hold the permission
android.Manifest.permission#FOREGROUND_SERVICE
. android.widget.LinearLayout
will always remeasure weighted children, even if there is no excess space.
Value: 28
Q
static val Q: Int
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.
Value: 29
R
static val R: Int
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.
- Behavior changes: all apps
- Behavior changes: Apps targeting Android 11
- Updates to non-SDK interface restrictions in Android 11
Value: 30
S_V2
static val S_V2: Int
S V2. Once more unto the breach, dear friends, once more.
Value: 32
VANILLA_ICE_CREAM
static val VANILLA_ICE_CREAM: Int
Vanilla Ice Cream.
Value: 35
Public constructors
VERSION_CODES
VERSION_CODES()