com.google.ar.core.exceptions.UnavailableSdkTooOldException Java Examples
The following examples show how to use
com.google.ar.core.exceptions.UnavailableSdkTooOldException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DemoUtils.java From ARCore-Location with MIT License | 6 votes |
/** Launch Application Setting to grant permission. *//* public static void launchPermissionSettings(Activity activity) { Intent intent = new Intent(); intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); intent.setData(Uri.fromParts("package", activity.getPackageName(), null)); activity.startActivity(intent); }*/ public static void handleSessionException( Activity activity, UnavailableException sessionException) { String message; if (sessionException instanceof UnavailableArcoreNotInstalledException) { message = "Please install ARCore"; } else if (sessionException instanceof UnavailableApkTooOldException) { message = "Please update ARCore"; } else if (sessionException instanceof UnavailableSdkTooOldException) { message = "Please update this app"; } else if (sessionException instanceof UnavailableDeviceNotCompatibleException) { message = "This device does not support AR"; } else { message = "Failed to create AR session"; Log.e(TAG, "Exception: " + sessionException); } Toast.makeText(activity, message, Toast.LENGTH_LONG).show(); }
Example #2
Source File: BaseActivity.java From justaline-android with Apache License 2.0 | 5 votes |
protected int getARCoreInstallErrorMessage(Exception e) { if (e instanceof UnavailableArcoreNotInstalledException || e instanceof UnavailableUserDeclinedInstallationException) { return R.string.install_arcore; } else if (e instanceof UnavailableApkTooOldException) { return R.string.update_arcore; } else if (e instanceof UnavailableSdkTooOldException) { return R.string.update_app; } else { return R.string.ar_not_supported; } }