Package 

Class BuildCompat


  • 
    public class BuildCompat
    
                        

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

    • Method Summary

      Modifier and Type Method Description
      static boolean isAtLeastN() Checks if the device is running on the Android N release or newer.
      static boolean isAtLeastNMR1() Checks if the device is running on the Android N MR1 release or newer.
      static boolean isAtLeastO() Checks if the device is running on a release version of Android O or newer.
      static boolean isAtLeastOMR1() Checks if the device is running on a release version of Android O MR1 or newer.
      static boolean isAtLeastP() Checks if the device is running on a release version of Android P or newer.
      static boolean isAtLeastQ() Checks if the device is running on release version of Android Q or newer.
      static boolean isAtLeastR() Checks if the device is running on a pre-release version of Android R or a releaseversion of Android R or newer.
      static boolean isAtLeastS() Checks if the device is running on a pre-release version of Android S or a release version ofAndroid S or newer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isAtLeastN

        @Deprecated() static boolean isAtLeastN()

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

      • isAtLeastNMR1

        @Deprecated() static boolean isAtLeastNMR1()

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

      • isAtLeastO

        @Deprecated() static boolean isAtLeastO()

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

      • isAtLeastOMR1

        @Deprecated() static boolean isAtLeastOMR1()

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

      • isAtLeastP

        @Deprecated() static boolean isAtLeastP()

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

      • isAtLeastQ

        @Deprecated() static boolean isAtLeastQ()

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

      • isAtLeastR

         static boolean isAtLeastR()

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

        Note: When Android R is finalized for release, this method will bedeprecated and all calls should be replaced with {@code Build.VERSION.SDK_INT >= Build.VERSION_CODES.R}.

      • isAtLeastS

         static boolean isAtLeastS()

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

        Note: When Android S is finalized for release, this method will bedeprecated and all calls should be replaced with {@code Build.VERSION.SDK_INT >= * Build.VERSION_CODES.S}.