BuildCompat
object BuildCompat
This class contains additional platform version checking methods for targeting pre-release versions of Android.
Summary
Nested types |
|---|
@RequiresOptInExperimental feature set for pre-release SDK checks. |
Public functions |
|
|---|---|
Boolean |
@ChecksSdkIntAtLeast(api = 36, codename = "Baklava")This function is deprecated. Android Baklava is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 3600001)This function is deprecated. Android Baklava minor release 1 is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 24)This function is deprecated. Android N is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 25)This function is deprecated. Android N MR1 is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 26)This function is deprecated. Android O is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 27)This function is deprecated. Android O MR1 is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 28)This function is deprecated. Android P is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 29)This function is deprecated. Android Q is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 30)This function is deprecated. Android R is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 31, codename = "S")This function is deprecated. Android S is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 32, codename = "Sv2")This function is deprecated. Android Sv2 is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 33, codename = "Tiramisu")This function is deprecated. Android Tiramisu is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 34, codename = "UpsideDownCake")This function is deprecated. Android UpsideDownCase is a finalized release and this method is no longer necessary. |
Boolean |
@ChecksSdkIntAtLeast(api = 35, codename = "VanillaIceCream")This function is deprecated. Android VanillaIceCream is a finalized release and this method is no longer necessary. |
Public properties |
|
|---|---|
Int |
@ChecksSdkIntAtLeast(extension = 1000000)The value of |
Int |
@ChecksSdkIntAtLeast(extension = 30)The value of |
Int |
@ChecksSdkIntAtLeast(extension = 31)The value of |
Int |
@ChecksSdkIntAtLeast(extension = 33)The value of |
Public functions
@ChecksSdkIntAtLeast(api = 36, codename = "Baklava")
funisAtLeastB(): Boolean
Checks if the device is running on a pre-release version of Android Baklava or a release version of Android Baklava or newer.
Note: When Android Baklava is finalized for release, this method will be removed and all calls must be replaced with Build.VERSION.SDK_INT >= 36.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 3600001)
funisAtLeastB_1(): Boolean
Checks if the device is running on a release version of Android Baklava minor release 1, or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 24)
funisAtLeastN(): Boolean
Checks if the device is running on the Android N release or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 25)
funisAtLeastNMR1(): Boolean
Checks if the device is running on the Android N MR1 release or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 26)
funisAtLeastO(): Boolean
Checks if the device is running on a release version of Android O or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 27)
funisAtLeastOMR1(): Boolean
Checks if the device is running on a release version of Android O MR1 or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 28)
funisAtLeastP(): Boolean
Checks if the device is running on a release version of Android P or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 29)
funisAtLeastQ(): Boolean
Checks if the device is running on release version of Android Q or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 30)
funisAtLeastR(): Boolean
Checks if the device is running on release version of Android R or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 31, codename = "S")
funisAtLeastS(): Boolean
Checks if the device is running on a pre-release version of Android S or a release version of Android S or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 32, codename = "Sv2")
funisAtLeastSv2(): Boolean
Checks if the device is running on a pre-release version of Android Sv2 or a release version of Android Sv2 or newer.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 33, codename = "Tiramisu")
funisAtLeastT(): Boolean
Checks if the device is running on a pre-release version of Android Tiramisu or a release version of Android Tiramisu or newer.
Note: When Android Tiramisu is finalized for release, this method will be removed and all calls must be replaced with Build.VERSION.SDK_INT >= 33.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 34, codename = "UpsideDownCake")
funisAtLeastU(): Boolean
Checks if the device is running on a pre-release version of Android UpsideDownCake or a release version of Android UpsideDownCake or newer.
Note: When Android UpsideDownCake is finalized for release, this method will be removed and all calls must be replaced with Build.VERSION.SDK_INT >= 34.
| Returns | |
|---|---|
Boolean |
|
@ChecksSdkIntAtLeast(api = 35, codename = "VanillaIceCream")
funisAtLeastV(): Boolean
Checks if the device is running on a pre-release version of Android VanillaIceCream or a release version of Android VanillaIceCream or newer.
Note: When Android VanillaIceCream is finalized for release, this method will be removed and all calls must be replaced with Build.VERSION.SDK_INT >= 35.
| Returns | |
|---|---|
Boolean |
|
Public properties
AD_SERVICES_EXTENSION_INT
@ChecksSdkIntAtLeast(extension = 1000000)
val AD_SERVICES_EXTENSION_INT: Int
The value of SdkExtensions.getExtensionVersion(AD_SERVICES). This is a convenience constant which provides the extension version in a similar style to Build.VERSION.SDK_INT.
Compared to calling getExtensionVersion directly, using this constant has the benefit of not having to verify the getExtensionVersion method is available.
| Returns | |
|---|---|
Int |
the version of the AdServices extension, if it exists. 0 otherwise. |
R_EXTENSION_INT
@ChecksSdkIntAtLeast(extension = 30)
val R_EXTENSION_INT: Int
The value of SdkExtensions.getExtensionVersion(R). This is a convenience constant which provides the extension version in a similar style to Build.VERSION.SDK_INT.
Compared to calling getExtensionVersion directly, using this constant has the benefit of not having to verify the getExtensionVersion method is available.
| Returns | |
|---|---|
Int |
the version of the R extension, if it exists. 0 otherwise. |
S_EXTENSION_INT
@ChecksSdkIntAtLeast(extension = 31)
val S_EXTENSION_INT: Int
The value of SdkExtensions.getExtensionVersion(S). This is a convenience constant which provides the extension version in a similar style to Build.VERSION.SDK_INT.
Compared to calling getExtensionVersion directly, using this constant has the benefit of not having to verify the getExtensionVersion method is available.
| Returns | |
|---|---|
Int |
the version of the S extension, if it exists. 0 otherwise. |
T_EXTENSION_INT
@ChecksSdkIntAtLeast(extension = 33)
val T_EXTENSION_INT: Int
The value of SdkExtensions.getExtensionVersion(TIRAMISU). This is a convenience constant which provides the extension version in a similar style to Build.VERSION.SDK_INT.
Compared to calling getExtensionVersion directly, using this constant has the benefit of not having to verify the getExtensionVersion method is available.
| Returns | |
|---|---|
Int |
the version of the T extension, if it exists. 0 otherwise. |