public static final enum
Config.GeospatialMode
Describes the desired behavior of ARCore Geospatial API features and capabilities. Not all
devices support all modes. Use Session.isGeospatialModeSupported(Config.GeospatialMode)
to find whether the
current device supports a particular Geospatial mode. The default value is DISABLED
.
Use Config.setGeospatialMode(Config.GeospatialMode)
to set the desired mode.
Inherited Methods
Enum Values
public static final Config.GeospatialMode DISABLED
DISABLED
public static final Config.GeospatialMode DISABLED
The Geospatial API is disabled. When a configuration with DISABLED
becomes active on the Session
, current Earth
and Anchor
objects created from Earth.createAnchor(double, double, double, float, float, float, float)
will stop updating; have their TrackingState
set to
TrackingState.STOPPED
; and Session.getEarth()
will return null
. If
re-enabled, you will need to call Session.getEarth()
again to obtain a new Earth
object.
public static final Config.GeospatialMode ENABLED
ENABLED
public static final Config.GeospatialMode ENABLED
The Geospatial API is enabled. Session.getEarth()
will return valid Earth
objects when a configuration becomes active with this mode through Session.configure(Config)
.
Using this mode requires your app do the following:
- Include the
ACCESS_INTERNET
permission to the app's AndroidManifest; otherwise,Session.configure(Config)
throwsSecurityException
. - Include the Google Play Services Location Library as a dependency for your app. See Declare
dependencies for Google Play services for instructions on how to include this
library in your app. If this library is not linked,
Session.configure(Config)
throwsGooglePlayServicesLocationLibraryNotLinkedException
. - Request and be granted the Android
ACCESS_FINE_LOCATION
permission; otherwise,Session.configure(Config)
throwsFineLocationPermissionNotGrantedException
.
Location is tracked only while the Session
is resumed. While the Session
is paused, Earth
's TrackingState
will be TrackingState.PAUSED
.
For more information, see documentation on the Geospatial API on Google Developers.
This mode is not compatible with the front-facing (selfie) camera. If Config.GeospatialMode
is ENABLED
on a session using the front-facing (selfie)
camera, Session.configure(Config)
will throw UnsupportedConfigurationException
.
Not all devices support ENABLED
, use Session.isGeospatialModeSupported(Config.GeospatialMode)
to check if the current device and selected camera support
enabling this mode. These checks are done in the call to Session.configure(Config)
.