當前位置: 首頁>>代碼示例>>Java>>正文


Java Version類代碼示例

本文整理匯總了Java中com.google.vr.ndk.base.Version的典型用法代碼示例。如果您正苦於以下問題:Java Version類的具體用法?Java Version怎麽用?Java Version使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Version類屬於com.google.vr.ndk.base包,在下文中一共展示了Version類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isVrCoreCompatible

import com.google.vr.ndk.base.Version; //導入依賴的package包/類
@Override
public boolean isVrCoreCompatible() {
    try {
        String vrCoreSdkLibraryVersionString = VrCoreUtils.getVrCoreSdkLibraryVersion(
                ContextUtils.getApplicationContext());
        Version vrCoreSdkLibraryVersion = Version.parse(vrCoreSdkLibraryVersionString);
        Version targetSdkLibraryVersion =
                Version.parse(com.google.vr.ndk.base.BuildConstants.VERSION);
        if (!vrCoreSdkLibraryVersion.isAtLeast(targetSdkLibraryVersion)) {
            throw new VrCoreNotAvailableException(ConnectionResult.SERVICE_OBSOLETE);
        }
        return true;
    } catch (VrCoreNotAvailableException e) {
        Log.i(TAG, "Unable to find a compatible VrCore.");
        return false;
    }
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:18,代碼來源:VrCoreVersionCheckerImpl.java

示例2: getVrCoreCompatibility

import com.google.vr.ndk.base.Version; //導入依賴的package包/類
@Override
public int getVrCoreCompatibility() {
    // Supported Build version is determined by the webvr cardboard support feature.
    // Default is KITKAT unless specified via server side finch config.
    if (Build.VERSION.SDK_INT < ChromeFeatureList.getFieldTrialParamByFeatureAsInt(
                                        ChromeFeatureList.WEBVR_CARDBOARD_SUPPORT,
                                        MIN_SDK_VERSION_PARAM_NAME,
                                        Build.VERSION_CODES.KITKAT)) {
        return VrCoreVersionChecker.VR_NOT_SUPPORTED;
    }
    try {
        String vrCoreSdkLibraryVersionString = VrCoreUtils.getVrCoreSdkLibraryVersion(
                ContextUtils.getApplicationContext());
        Version vrCoreSdkLibraryVersion = Version.parse(vrCoreSdkLibraryVersionString);
        Version targetSdkLibraryVersion =
                Version.parse(com.google.vr.ndk.base.BuildConstants.VERSION);
        if (!vrCoreSdkLibraryVersion.isAtLeast(targetSdkLibraryVersion)) {
            return VrCoreVersionChecker.VR_OUT_OF_DATE;
        }
        return VrCoreVersionChecker.VR_READY;
    } catch (VrCoreNotAvailableException e) {
        Log.i(TAG, "Unable to find VrCore.");
        // Old versions of VrCore are not integrated with the sdk library version check and will
        // trigger this exception even though VrCore is installed.
        // Double check package manager to make sure we are not telling user to install
        // when it should just be an update.
        if (PackageUtils.getPackageVersion(
                    ContextUtils.getApplicationContext(), VR_CORE_PACKAGE_ID)
                != -1) {
            return VrCoreVersionChecker.VR_OUT_OF_DATE;
        }
        return VrCoreVersionChecker.VR_NOT_AVAILABLE;
    }
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:35,代碼來源:VrCoreVersionCheckerImpl.java


注:本文中的com.google.vr.ndk.base.Version類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。