Android Open Source - Android-SecretCodes Platform Version






From Project

Back to project page Android-SecretCodes.

License

The source code is released under:

Apache License

If you think the Android project Android-SecretCodes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fr.simon.marquis.secretcodes.util;
/*  w  w  w. java2  s.  c o m*/
import android.os.Build;

/**
 * Utility methods to check the Android OS version.
 */
public final class PlatformVersion {

    private PlatformVersion() {
        // No public constructor
    }

    /**
     * @return Whether the current OS version is higher or equal to Froyo (API
     * 8+).
     */
    public static boolean isAtLeastFroyo() {
        return checkVersion(Build.VERSION_CODES.FROYO);
    }

    /**
     * @return Whether the current OS version is higher or equal to Gingerbread
     * (API 9+).
     */
    public static boolean isAtLeastGingerbread() {
        return checkVersion(Build.VERSION_CODES.GINGERBREAD);
    }

    /**
     * @return Whether the current OS version is higher or equal to Gingerbread
     * MR1 (API 10+).
     */
    public static boolean isAtLeastGingerbreadMR1() {
        return checkVersion(Build.VERSION_CODES.GINGERBREAD_MR1);
    }

    /**
     * @return Whether the current OS version is higher or equal to Honeycomb
     * (API 11+).
     */
    public static boolean isAtLeastHoneycomb() {
        return checkVersion(Build.VERSION_CODES.HONEYCOMB);
    }

    /**
     * @return Whether the current OS version is higher or equal to Honeycomb
     * MR1 (API 12+).
     */
    public static boolean isAtLeastHoneycombMR1() {
        return checkVersion(Build.VERSION_CODES.HONEYCOMB_MR1);
    }

    /**
     * @return Whether the current OS version is higher or equal to Honeycomb
     * MR2 (API 13+).
     */
    public static boolean isAtLeastHoneycombMR2() {
        return checkVersion(Build.VERSION_CODES.HONEYCOMB_MR2);
    }

    /**
     * @return Whether the current OS version is higher or equal to Ice Cream
     * Sandwich (API 14+).
     */
    public static boolean isAtLeastIceCreamSandwich() {
        return checkVersion(Build.VERSION_CODES.ICE_CREAM_SANDWICH);
    }

    /**
     * @return Whether the current OS version is higher or equal to Ice Cream
     * Sandwich MR1 (API 15+).
     */
    public static boolean isAtLeastIceCreamSandwichMR1() {
        return checkVersion(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1);
    }

    /**
     * @return Whether the current OS version is higher or equal to Jelly Bean
     * (API 16+).
     */
    public static boolean isAtLeastJellyBean() {
        return checkVersion(Build.VERSION_CODES.JELLY_BEAN);
    }

    /**
     * @return Whether the current OS version is higher or equal to Jelly Bean
     * MR1 (API 17+).
     */
    public static boolean isAtLeastJellyBeanMR1() {
        return checkVersion(Build.VERSION_CODES.JELLY_BEAN_MR1);
    }

    /**
     * @return Whether the current OS version is higher or equal to Jelly Bean
     * MR2 (API 18+).
     */
    public static boolean isAtLeastJellyBeanMR2() {
        return checkVersion(Build.VERSION_CODES.JELLY_BEAN_MR2);
    }

    /**
     * Check whether the current OS version is higher or equal to the given
     * minimum SDK version
     *
     * @param minSdkVersion The minimum SDK version to test against.
     * @return Whether the current OS version is higher or equal to the given
     * minimum SDK version.
     */
    private static boolean checkVersion(int minSdkVersion) {
        return Build.VERSION.SDK_INT >= minSdkVersion;
    }
}




Java Source Code List

fr.simon.marquis.secretcodes.model.SecretCode.java
fr.simon.marquis.secretcodes.roboto.RobotoTextView.java
fr.simon.marquis.secretcodes.roboto.RobotoTypefaceManager.java
fr.simon.marquis.secretcodes.service.CrawlerService.java
fr.simon.marquis.secretcodes.ui.AboutDialog.java
fr.simon.marquis.secretcodes.ui.CrawlerNotification.java
fr.simon.marquis.secretcodes.ui.MainActivity.java
fr.simon.marquis.secretcodes.ui.SecretCodeAdapter.java
fr.simon.marquis.secretcodes.util.CustomTypefaceSpan.java
fr.simon.marquis.secretcodes.util.ExportContentProvider.java
fr.simon.marquis.secretcodes.util.PlatformVersion.java
fr.simon.marquis.secretcodes.util.Utils.java