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
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getAPIVersion()
      Indicates the current version of the ArcGIS Runtime SDK for Android.
      static License getLicense()
      The current license information, such as the license level, that the environment is using to validate that the app is licensed for certain functionality.
      static LicenseResult setLicense​(LicenseInfo licenseInfo)
      Licenses the application using the given LicenseInfo, and returns a LicenseResult indicating the outcome of the license operation.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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)