app/src/main/java/edu/devslabgt/fjbatresv/arexample/Utils.java
/**
     * Creates an ARCore session. This checks for the CAMERA permission, and if granted, checks the
     * state of the ARCore installation. If there is a problem an exception is thrown. Care must be
     * taken to update the installRequested flag as needed to avoid an infinite checking loop. It
     * should be set to true if null is returned from this method, and called again when the
     * application is resumed.
     *
     * @param activity - the activity currently active.
     * @param installRequested - the indicator for ARCore that when checking the state of ARCore, if
     *     an installation was already requested. This is true if this method previously returned
     *     null. and the camera permission has been granted.
     */
Creates an ARCore session. This checks for the CAMERA permission, and if granted, checks the
state of the ARCore installation. If there is a problem an exception is thrown. Care must be
taken to update the installRequested flag as needed to avoid an infinite checking loop. It
should be set to true if null is returned from this method, and called again when the
application is resumed.

@param activity - the activity currently active.
@param installRequested - the indicator for ARCore that when checking the state of ARCore, if
an installation was already requested. This is true if this method previously returned
null. and the camera permission has been granted.
Creates an ARCore session . This checks for the CAMERA permission and if granted checks the state of the ARCore installation . If there is a problem an exception is thrown . Care must be taken to update the installRequested flag as needed to avoid an infinite checking loop . It should be set to true if null is returned from this method and called again when the application is resumed . @param activity - the activity currently active . @param installRequested - the indicator for ARCore that when checking the state of ARCore if an installation was already requested . This is true if this method previously returned null . and the camera permission has been granted .
public static Session createArSession(Activity activity, boolean installRequested)
            throws UnavailableException {
        Session session = null;
        if (hasCameraPermission(activity)) {
            switch (ArCoreApk.getInstance().requestInstall(activity, !installRequested)) {
                case INSTALL_REQUESTED:
                    return null;
                case INSTALLED:
                    break;
            }
            session = new Session(activity);
            Config config = new Config(session);
            config.setUpdateMode(Config.UpdateMode.LATEST_CAMERA_IMAGE);
            session.configure(config);
        }
        return session;
    }
public static Session createArSession ( Activity activity , boolean installRequested ) throws UnavailableException { Session session = null ; if ( hasCameraPermission ( activity ) ) { switch ( ArCoreApk . getInstance ( ) . requestInstall ( activity , ! installRequested ) ) { case INSTALL_REQUESTED : return null ; case INSTALLED : break ; } session = new Session ( activity ) ; Config config = new Config ( session ) ; config . setUpdateMode ( Config . UpdateMode . LATEST_CAMERA_IMAGE ) ; session . configure ( config ) ; } return session ; }
Creates an ARCore session.
Creates an ARCore session .
// if we have the camera permission, create the session // IMPORTANT!!!  ArSceneView requires the `LATEST_CAMERA_IMAGE` non-blocking update mode.