All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.crossbar.autobahn.utils.Platform Maven / Gradle / Ivy

The newest version!
///////////////////////////////////////////////////////////////////////////////
//
//   AutobahnJava - http://crossbar.io/autobahn
//
//   Copyright (c) Crossbar.io Technologies GmbH and contributors
//
//   Licensed under the MIT License.
//   http://www.opensource.org/licenses/mit-license.php
//
///////////////////////////////////////////////////////////////////////////////

package io.crossbar.autobahn.utils;

public class Platform {
    private static boolean IS_PLATFORM_CHECKED = false;
    private static boolean IS_ANDROID = false;

    /**
     * Checks if code is running on Android.
     *
     * @return boolean representing whether the underlying platform
     *     is Android based
     */
    public static boolean isAndroid() {
        if (!IS_PLATFORM_CHECKED) {
            IS_ANDROID = System.getProperty("java.vendor").equals("The Android Project");
            IS_PLATFORM_CHECKED = true;
        }
        return IS_ANDROID;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy