BuildCompat

open class BuildCompat
kotlin.Any
   ↳ androidx.core.os.BuildCompat

This class contains additional platform version checking methods for targeting pre-release versions of Android.

Summary

Public methods

open static Boolean

Checks if the device is running on the Android N release or newer.

open static Boolean

Checks if the device is running on the Android N MR1 release or newer.

open static Boolean

Checks if the device is running on a pre-release version of Android O or newer.

open static Boolean

Checks if the device is running on a pre-release version of Android O MR1 or newer.

open static Boolean

Checks if the device is running on a pre-release version of Android P or newer.

open static Boolean

Checks if the device is running on a pre-release version of Android Q or newer.

open static Boolean

Checks if the device is running on a pre-release version of Android R or newer.

Public methods

isAtLeastN

open static fun isAtLeastN(): Boolean

Deprecated: Android N is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead, use Build.VERSION.SDK_INT >= Build.VERSION_CODES.N.

Checks if the device is running on the Android N release or newer.

Return
Boolean: true if N APIs are available for use

isAtLeastNMR1

open static fun isAtLeastNMR1(): Boolean

Deprecated: Android N MR1 is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead, use Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1.

Checks if the device is running on the Android N MR1 release or newer.

Return
Boolean: true if N MR1 APIs are available for use

isAtLeastO

open static fun isAtLeastO(): Boolean

Deprecated: Android O is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead use Build.VERSION.SDK_INT >= Build.VERSION_CODES.O.

Checks if the device is running on a pre-release version of Android O or newer.

Return
Boolean: true if O APIs are available for use, false otherwise

isAtLeastOMR1

open static fun isAtLeastOMR1(): Boolean

Deprecated: Android O MR1 is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead, use Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1.

Checks if the device is running on a pre-release version of Android O MR1 or newer.

Return
Boolean: true if O MR1 APIs are available for use, false otherwise

isAtLeastP

open static fun isAtLeastP(): Boolean

Deprecated: Android P is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead, use Build.VERSION.SDK_INT >= Build.VERSION_CODES.P.

Checks if the device is running on a pre-release version of Android P or newer.

Return
Boolean: true if P APIs are available for use, false otherwise

isAtLeastQ

open static fun isAtLeastQ(): Boolean

Deprecated: Android Q is a finalized release and this method is no longer necessary. It will be removed in a future release of the Support Library. Instead, use Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q.

Checks if the device is running on a pre-release version of Android Q or newer.

Return
Boolean: true if Q APIs are available for use, false otherwise

isAtLeastR

open static fun isAtLeastR(): Boolean

Checks if the device is running on a pre-release version of Android R or newer.

Note: This method will return false on devices running release versions of Android. When Android R is finalized for release, this method will be deprecated and all calls should be replaced with Build.VERSION.SDK_INT >= Build.VERSION_CODES.R.

Return
Boolean: true if R APIs are available for use, false otherwise