# Build.VERSION

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# VERSION

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/os/Build.VERSION "View this page in Java")  

```
open class VERSION
```

|---|------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                       ||
| ↳ | [android.os.Build.VERSION](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#) |

Various version strings.

## Summary

|                                            Public constructors                                             ||
|---------------------------------------------------------------------------------------------------------|---|
| [VERSION](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#VERSION())`()` <br /> |

|                                                                                                                                                                                                                     Properties                                                                                                                                                                                                                      ||
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [BASE_OS](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#BASE_OS:kotlin.String) The base OS build the product is based on.                                                                                                                                                                                                        |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [CODENAME](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#CODENAME:kotlin.String) The current development codename, or the string "REL" if this is a release build.                                                                                                                                                               |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [INCREMENTAL](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#INCREMENTAL:kotlin.String) The internal value used by the underlying source control to represent this build.                                                                                                                                                         |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [MEDIA_PERFORMANCE_CLASS](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#MEDIA_PERFORMANCE_CLASS:kotlin.Int) The media performance class of the device or 0 if none.                                                                                                                                                              |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [PREVIEW_SDK_INT](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#PREVIEW_SDK_INT:kotlin.Int) The developer preview revision of a prerelease SDK.                                                                                                                                                                                  |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [RELEASE](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE:kotlin.String) The user-visible version string.                                                                                                                                                                                                                  |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)  | [RELEASE_OR_CODENAME](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE_OR_CODENAME:kotlin.String) The version string.                                                                                                                                                                                                       |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)  | [RELEASE_OR_PREVIEW_DISPLAY](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE_OR_PREVIEW_DISPLAY:kotlin.String) The version string we show to the user; may be[RELEASE](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE:kotlin.String)or a descriptive string if not a final release build. |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [SDK](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK:kotlin.String) The user-visible SDK version of the framework in its raw String representation; use[SDK_INT](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT:kotlin.Int)instead.                                                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [SDK_INT](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT:kotlin.Int) The SDK version of the software currently running on this hardware device.                                                                                                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [SDK_INT_FULL](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT_FULL:kotlin.Int) The major and minor SDK version of the software currently running on this hardware device.                                                                                                                                                 |
| static[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [SECURITY_PATCH](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SECURITY_PATCH:kotlin.String) The user-visible security patch level.                                                                                                                                                                                              |

## Public constructors

### VERSION

```
VERSION()
```

## Properties

### BASE_OS

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val BASE_OS: String!
```

The base OS build the product is based on.  

### CODENAME

Added in[API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CODENAME: String!
```

The current development codename, or the string "REL" if this is a release build.  

### INCREMENTAL

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val INCREMENTAL: String!
```

The internal value used by the underlying source control to represent this build. E.g., a perforce changelist number or a git hash.  

### MEDIA_PERFORMANCE_CLASS

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_PERFORMANCE_CLASS: Int
```

The media performance class of the device or 0 if none.

If this value is not`0`, the device conforms to the media performance class definition of the SDK version of this value. This value never changes while a device is booted, but it may increase when the hardware manufacturer provides an OTA update.

Possible non-zero values are defined in[Build.VERSION_CODES](https://developer.android.com/reference/kotlin/android/os/Build.VERSION_CODES)starting with[Build.VERSION_CODES.R](https://developer.android.com/reference/kotlin/android/os/Build.VERSION_CODES#R:kotlin.Int).  

### PREVIEW_SDK_INT

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val PREVIEW_SDK_INT: Int
```

The developer preview revision of a prerelease SDK. This value will always be`0`on production platform builds/devices.

When this value is nonzero, any new API added since the last officially published[API level](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT:kotlin.Int)is only guaranteed to be present on that specific preview revision. For example, an API`Activity.fooBar()`might be present in preview revision 1 but renamed or removed entirely in preview revision 2, which may cause an app attempting to call it to crash at runtime.

Experimental apps targeting preview APIs should check this value for equality (`==`) with the preview SDK revision they were built for before using any prerelease platform APIs. Apps that detect a preview SDK revision other than the specific one they expect should fall back to using APIs from the previously published API level only to avoid unwanted runtime exceptions.  

### RELEASE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RELEASE: String!
```

The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas". This field is an opaque string. Do not assume that its value has any particular structure or that values of RELEASE from different releases can be somehow ordered.  

### RELEASE_OR_CODENAME

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RELEASE_OR_CODENAME: String
```

The version string. May be[RELEASE](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE:kotlin.String)or[CODENAME](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#CODENAME:kotlin.String)if not a final release build.  

### RELEASE_OR_PREVIEW_DISPLAY

Added in[API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val RELEASE_OR_PREVIEW_DISPLAY: String
```

The version string we show to the user; may be[RELEASE](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#RELEASE:kotlin.String)or a descriptive string if not a final release build.  

### SDK

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SDK: String!
```

**Deprecated:** *Use[SDK_INT](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT:kotlin.Int)to easily get this as an integer.*

The user-visible SDK version of the framework in its raw String representation; use[SDK_INT](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT:kotlin.Int)instead.  

### SDK_INT

Added in[API level 4](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SDK_INT: Int
```

The SDK version of the software currently running on this hardware device. This value never changes while a device is booted, but it may increase when the hardware manufacturer provides an OTA update.

This constant records the major version of Android. Use[SDK_INT_FULL](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT_FULL:kotlin.Int)if you need to consider the minor version of Android as well.

Possible values are defined in[Build.VERSION_CODES](https://developer.android.com/reference/kotlin/android/os/Build.VERSION_CODES).  
**See Also**

- [#SDK_INT_FULL](https://developer.android.com/reference/kotlin/android/os/Build.VERSION#SDK_INT_FULL:kotlin.Int)  

### SDK_INT_FULL

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SDK_INT_FULL: Int
```

The major and minor SDK version of the software currently running on this hardware device. This value never changes while a device is booted, but it may increase when the hardware manufacturer provides an OTA update.

`SDK_INT`is increased on new Android dessert releases, also called major releases. Between these, Android may also release minor releases where`SDK_INT`remains unchanged. Minor releases can add new APIs, and have stricter guarantees around backwards compatibility (e.g. no changes gated by`targetSdkVersion`) compared to major releases.

`SDK_INT_FULL`is increased on every release.

Possible values are defined in .  

### SECURITY_PATCH

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SECURITY_PATCH: String!
```

The user-visible security patch level. This value represents the date when the device most recently applied a security patch.