# BuildCompat

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1  
Summary:[Methods](https://developer.android.com/reference/android/support/v4/os/BuildCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v4/os/BuildCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v4/os/BuildCompat#)  

# BuildCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
BuildCompat
`  
`

extends Object


``


`

|---|-----------------------------------|
| java.lang.Object                     ||
| ↳ | android.support.v4.os.BuildCompat |

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                      ### Public methods                                                                                                                                                                                       ||
|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static boolean` | ` `[isAtLeastN](https://developer.android.com/reference/android/support/v4/os/BuildCompat#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`.*               |
| ` static boolean` | ` `[isAtLeastNMR1](https://developer.android.com/reference/android/support/v4/os/BuildCompat#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`.* |
| ` static boolean` | ` `[isAtLeastO](https://developer.android.com/reference/android/support/v4/os/BuildCompat#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`.*                |
| ` static boolean` | ` `[isAtLeastOMR1](https://developer.android.com/reference/android/support/v4/os/BuildCompat#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`.* |
| ` static boolean` | ` `[isAtLeastP](https://developer.android.com/reference/android/support/v4/os/BuildCompat#isAtLeastP())`() ` Checks if the device is running on a pre-release version of Android P or newer.                                                                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v4/os/BuildCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### isAtLeastN

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isAtLeastN ()
```

<br />

**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.

<br />

|                         Returns                         ||
|-----------|----------------------------------------------|
| `boolean` | `true`if N APIs are available for use <br /> |

### isAtLeastNMR1

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isAtLeastNMR1 ()
```

<br />

**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.

<br />

|                           Returns                           ||
|-----------|--------------------------------------------------|
| `boolean` | `true`if N MR1 APIs are available for use <br /> |

### isAtLeastO

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isAtLeastO ()
```

<br />

**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.

<br />

<br />

|                                 Returns                                  ||
|-----------|---------------------------------------------------------------|
| `boolean` | `true`if O APIs are available for use,`false`otherwise <br /> |

### isAtLeastOMR1

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isAtLeastOMR1 ()
```

<br />

**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.

<br />

<br />

|                                   Returns                                    ||
|-----------|-------------------------------------------------------------------|
| `boolean` | `true`if O MR1 APIs are available for use,`false`otherwise <br /> |

### isAtLeastP

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean 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`.

<br />

|                                 Returns                                  ||
|-----------|---------------------------------------------------------------|
| `boolean` | `true`if P APIs are available for use,`false`otherwise <br /> |

-

  ## Interfaces

  - [CancellationSignal.OnCancelListener](https://developer.android.com/reference/android/support/v4/os/CancellationSignal.OnCancelListener)
  - [ParcelableCompatCreatorCallbacks](https://developer.android.com/reference/android/support/v4/os/ParcelableCompatCreatorCallbacks)
-

  ## Classes

  - [BuildCompat](https://developer.android.com/reference/android/support/v4/os/BuildCompat)
  - [CancellationSignal](https://developer.android.com/reference/android/support/v4/os/CancellationSignal)
  - [ConfigurationCompat](https://developer.android.com/reference/android/support/v4/os/ConfigurationCompat)
  - [EnvironmentCompat](https://developer.android.com/reference/android/support/v4/os/EnvironmentCompat)
  - [LocaleListCompat](https://developer.android.com/reference/android/support/v4/os/LocaleListCompat)
  - [ParcelableCompat](https://developer.android.com/reference/android/support/v4/os/ParcelableCompat)
  - [TraceCompat](https://developer.android.com/reference/android/support/v4/os/TraceCompat)
  - [UserManagerCompat](https://developer.android.com/reference/android/support/v4/os/UserManagerCompat)
-

  ## Exceptions

  - [OperationCanceledException](https://developer.android.com/reference/android/support/v4/os/OperationCanceledException)