Class ArcGISRuntimeEnvironment


  • public final class ArcGISRuntimeEnvironment
    extends java.lang.Object
    Defines an ArcGIS Runtime Environment object.

    Contains methods that affect the entire runtime environment. Also contains static methods to set up deployment licensing for an application.

    The use of some members in the ArcGIS Runtime API requires a specific license level. Please refer to Licensing details by class.

    Since:
    100.0.0
    • Constructor Detail

      • ArcGISRuntimeEnvironment

        public ArcGISRuntimeEnvironment()
    • Method Detail

      • getAPIVersion

        public static java.lang.String getAPIVersion()
        Indicates the current version of the ArcGIS Runtime SDK for Android.
        Returns:
        the API version.
        Since:
        100.0.0
      • setLicense

        public static LicenseResult setLicense​(java.lang.String licenseKey)
        Licenses the application using the given license key, and returns a LicenseResult indicating the outcome of the license operation. This method returns a LicenseResult which contains a license status of either Invalid, Expired, or Valid. This will remove the watermark present at LicenseLevel.DEVELOPER and must be called in a deployed application.

        Note: If any licensed functionality (LITE, BASIC, STANDARD, or ADVANCED) is accessed before setting the license, an exception will be thrown.

        Parameters:
        licenseKey - the ESRI license key
        Returns:
        LicenseResult the license result of attempting to set the main license
        Since:
        100.0.0
        See Also:
        setLicense(LicenseInfo), setLicense(String, List)
      • setLicense

        public static LicenseResult setLicense​(LicenseInfo licenseInfo)
        Licenses the application using the given LicenseInfo, and returns a LicenseResult indicating the outcome of the license operation.

        License info is for named-user access. A LicenseInfo can be obtained from a portal for the current logged in user by calling Portal.fetchLicenseInfoAsync(). The LicenseInfo instance is only valid for 30 days, so the user will be required to log into the portal again when this expires.

        This method will return a LicenseResult which contains the LicenseStatus. The LicenseStatus is either LicenseStatus.VALID, LicenseStatus.INVALID, LicenseStatus.EXPIRED (if the user's subscription on the portal has expired), or LicenseStatus.LOGIN_REQUIRED (if the user needs to log in to the portal to renew the LicenseInfo).

        Parameters:
        licenseInfo - license information from a portal
        Returns:
        the license result of attempting to set the main license
        Throws:
        java.lang.IllegalArgumentException - if licenseInfo is null
        Since:
        100.0.0
        See Also:
        setLicense(String), setLicense(String, List), LicenseStatus
      • setLicense

        public static LicenseResult setLicense​(java.lang.String licenseKey,
                                               java.util.List<java.lang.String> extensions)
        Licenses the application using the given license key and list of extensions, and returns a LicenseResult indicating the outcome of the license operation. This method returns a LicenseResult which contains a LicenseStatus of either LicenseStatus.Invalid, LicenseStatus.Expired, or LicenseStatus.Valid for the Runtime license. The returned LicenseResult includes a java.util.Map containing a LicenseStatus for each requested extension.
        Parameters:
        licenseKey - application license key
        extensions - a list of extension licenseKey strings
        Returns:
        the license result of attempting to set the main license
        Throws:
        java.lang.IllegalArgumentException - if extensions is null
        Since:
        100.0.0
        See Also:
        setLicense(String), setLicense(LicenseInfo)
      • setApiKey

        public static void setApiKey​(java.lang.String apiKey)
        Sets the unique key generated from ArcGIS Developers website.
        Parameters:
        apiKey - the unique key generated from ArcGIS Developers website
        Since:
        100.10.0
      • getApiKey

        public static java.lang.String getApiKey()
        Gets the unique key generated from ArcGIS Developers website.
        Returns:
        the unique key generated from ArcGIS Developers website
        Since:
        100.10.0
      • addArcadeConsoleMessageListener

        public static void addArcadeConsoleMessageListener​(ArcadeConsoleMessageListener listener)
        Adds an ArcadeConsoleMessageListener that gets invoked whenever a console message is sent from any Arcade script.

        This callback allows clients to retrieve messages from evaluating an Arcade script expression in an attribute rule, labeling, popup, dictionary renderer, geotrigger, and more.

        Adding this listener on the UI thread will cause it to be invoked on the UI thread, otherwise it is not guaranteed on which thread the listener is invoked.

        Parameters:
        listener - an ArcadeConsoleMessageListener that gets invoked whenever a console message is sent
        Throws:
        java.lang.IllegalArgumentException - if listener is null
        Since:
        100.14.0
        See Also:
        removeArcadeConsoleMessageListener(ArcadeConsoleMessageListener)
      • getServiceCurveGeometryMode

        public static ServiceCurveGeometryMode getServiceCurveGeometryMode()
        Determines if curve geometries are fetched from and sent to services that support them.

        By default, curve geometries are not fetched from services that support curves, meaning that densified versions of any curve geometries are fetched from the service. To instead fetch original geometries with curve segments (those where Geometry.hasCurves() is true), set this property to ServiceCurveGeometryMode.FETCH_CURVES. Ensure that you do this before any calls to services are made, as it cannot be changed after the first request has begun.

        By default, Runtime indicates that is it not a true curve capable client when sending updates to services that support curves. This means that curve geometries stored in services where ArcGISFeatureServiceInfo.isOnlyAllowTrueCurveUpdatesByTrueCurveClients() is true cannot be updated by default. To update such geometries, ensure your app correctly handles curve segments in geometries throughout the workflow and set this property to ServiceCurveGeometryMode.TRUE_CURVE_CLIENT. You must do this before any calls to services are made - it cannot be changed after making the first request.

        For details of curve support in services, see ArcGIS REST API documentation.

        For services that don't support curves, this value has no effect. It also has no effect on local data sources that may contain curve geometries, such as mobile geodatabases or mobile map packages created using ArcGIS Pro. Some geometry operations do not support curve geometries; see GeometryEngine for details of curve support. SketchEditor does not support curve geometries.

        Returns:
        determines if curve geometries are fetched from and sent to services that support them
        Since:
        100.12.0
        See Also:
        Geometry.hasCurves()
      • setServiceCurveGeometryMode

        public static void setServiceCurveGeometryMode​(ServiceCurveGeometryMode serviceCurveGeometryMode)
        Determines if curve geometries are fetched from and sent to services that support them.

        By default, curve geometries are not fetched from services that support curves, meaning that densified versions of any curve geometries are fetched from the service. To instead fetch original geometries with curve segments (those where Geometry.hasCurves() is true), set this property to ServiceCurveGeometryMode.FETCH_CURVES. Ensure that you do this before any calls to services are made, as it cannot be changed after the first request has begun.

        By default, Runtime indicates that is it not a true curve capable client when sending updates to services that support curves. This means that curve geometries stored in services where ArcGISFeatureServiceInfo.isOnlyAllowTrueCurveUpdatesByTrueCurveClients() is true cannot be updated by default. To update such geometries, ensure your app correctly handles curve segments in geometries throughout the workflow and set this property to ServiceCurveGeometryMode.TRUE_CURVE_CLIENT. You must do this before any calls to services are made - it cannot be changed after making the first request.

        For details of curve support in services, see ArcGIS REST API documentation.

        For services that don't support curves, this value has no effect. It also has no effect on local data sources that may contain curve geometries, such as mobile geodatabases or mobile map packages created using ArcGIS Pro.

        Some geometry operations do not support curve geometries; see GeometryEngine for details of curve support. SketchEditor does not support curve geometries.

        Parameters:
        serviceCurveGeometryMode - determines if curve geometries are fetched from and sent to services that support them
        Throws:
        java.lang.IllegalArgumentException - if serviceCurveGeometryMode is null
        ArcGISRuntimeException - if attempt was made too late to change if curves are fetched from or sent to services
        Since:
        100.12.0
        See Also:
        Geometry.hasCurves()