本文整理匯總了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;
}
}