# AndroidVersion

# 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  

<br />

```
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[codename](https://developer.android.com/reference/tools/gradle-api/8.6/com/android/build/api/variant/AndroidVersion#codename()).

## Summary

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)          | [apiLevel](https://developer.android.com/reference/tools/gradle-api/8.6/com/android/build/api/variant/AndroidVersion#apiLevel()) SDK version codes mirroring ones found in Build#VERSION_CODES on Android. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [codename](https://developer.android.com/reference/tools/gradle-api/8.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.