当前位置: 首页>>代码示例>>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;未经允许,请勿转载。