BuildCompat

This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack.
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.

Summary

Public methods

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#N.

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#N_MR1.

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#O.

This method was deprecated
in API level 27.1.0.
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.SDK_INT >= Build.VERSION_CODES#O_MR1.

Public methods

isAtLeastN

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#N.

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

Returns

boolean

true if N APIs are available for use

isAtLeastNMR1

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#N_MR1.

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

Returns

boolean

true if N MR1 APIs are available for use

isAtLeastO

This method was deprecated
in API level 26.1.0.
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.SDK_INT >= Build.VERSION_CODES#O.

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

Returns

boolean

true if O APIs are available for use, false otherwise

isAtLeastOMR1

This method was deprecated
in API level 27.1.0.
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.SDK_INT >= Build.VERSION_CODES#O_MR1.

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

Returns

boolean

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

isAtLeastP

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

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