# AndroidVersion

[View Source](https://cs.android.com/search?q=file:com/android/build/api/variant/AndroidVersion.kt+class:com.android.build.api.variant.AndroidVersion) Added in 4.2.0


```
interface AndroidVersion
```

<br />

*** ** * ** ***

A version of the Android platform.

This includes support for preview versions that don't have a final API level, but instead use a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidVersion#codename()`.

## Summary

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidVersion#apiLevel()` SDK version codes mirroring ones found in Build#VERSION_CODES on Android. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidVersion#codename()` Preview versions of the platform are identified by a code name. |

## Public properties

### apiLevel

Added in 4.2.0

```
val apiLevel: Int
```

SDK version codes mirroring ones found in Build#VERSION_CODES on Android.

### codename

Added in 4.2.0

```
val codename: String?
```

Preview versions of the platform are identified by a code name. Their API level is usually set to the value of the previous platform.