本文整理汇总了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;
}
}
示例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;
}
}