Class License


  • public final class License
    extends java.lang.Object
    Provides methods to manage the licensing of the ArcGIS Runtime.

    An application runs in developer mode (LicenseLevel.Developer) until it is licensed. All functionality is available, but the GeoView is watermarked. To turn off the watermark, a deployed application must run with Lite license level or higher. Some functionality is only available with a specific license level; you must license your app appropriately for the functionality it contains. Any attempt to use licensed functionality that is not available at the current LicenseLevel will throw an ArcGISRuntimeException. See Licensing details by class for details.

    Your app can be licensed in one of two ways:

    • With a license key (a string) acquired from the ArcGIS for Developers website or Esri Customer Service.
    • With license information retrieved after logging in to a portal.

    To license with a license key, call ArcGISRuntimeEnvironment.setLicense(String). You can obtain a license string from the ArcGIS for Developers website or Esri Customer Service.

    To validate with information from a portal, you need a LicenseInfo instance. This can be obtained by calling Portal.fetchLicenseInfoAsync(). Pass the LicenseInfo to ArcGISRuntimeEnvironment.setLicense(LicenseInfo).

    Both these setLicense methods return a LicenseResult indicating whether or not the license is valid.

    Note
    A license that is set using LicenseInfo will time out if the application has not connected to the network for 30 days or more. A timed-out license has the following consequences: (1) Calling ArcGISRuntimeEnvironment.setLicense(LicenseInfo) returns a LicenseResult in which the LicenseResult.getLicenseStatus() is LicenseStatus.LOGIN_REQUIRED. (2) The application continues to run at the current license level, which is LicenseLevel.DEVELOPER by default.

    To resume using the timed-out license, the user must log in to the portal again.

    Since:
    100.0.0
    • Method Detail

      • getLicenseLevel

        public LicenseLevel getLicenseLevel()
        Gets the current license level set in the application. The current license level may be Developer, Lite, Basic, Standard, or Advanced. By default, when an app is launched it runs at the Developer license level until a deployment license has been provided. The license level can change while an app runs. For instance, the app may start running licensed with a LicenseLevel.LITE and can upgrade to LicenseLevel.BASIC or higher. Also note that we cannot downgrade the LicenseLevel for an app once the LicenseLevel is set.
        Returns:
        the current license level
        Since:
        100.0.0
      • isPermanent

        public boolean isPermanent()
        Returns true if extension license is permanent; false otherwise Most extension license keys do not expire.
        Returns:
        true if the license is permanent
        Since:
        100.0.0
      • getLicenseStatus

        public LicenseStatus getLicenseStatus()
        Returns the license status for the current license applied to the app. Usually this status returns Valid because the current License object always contains the most current valid license.
        Returns:
        the current status of the license
        Since:
        100.0.0
        See Also:
        LicenseStatus
      • getLicenseType

        public LicenseType getLicenseType()
        Returns the current license type for the license applied to the app. In developer mode, this function returns LicenseType.DEVELOPER. Otherwise, it can return LicenseType.NAMED_USER if the app was licensed by logging in to a portal and acquiring LicenseInfo, or LicenseType.LICENSE_KEY if the app was licensed from a license key string. The license type can change while an app runs. For instance, the app may start running licensed with a Lite license key (LicenseKey) and later become licensed from LicenseInfo (LicenseType.NAMED_USER).
        Returns:
        the license type
        Since:
        100.0.0
        See Also:
        LicenseType
      • getExtensions

        public java.util.List<ExtensionLicense> getExtensions()
        Returns a list of extension licenses that were applied to the app. For valid extension license keys supplied when calling ArcGISRuntimeEnvironment.setLicense(String, List), this list is populated with information about the extension license. Use this function to iterate through extension licenses that are available in the app environment. All extension licensed functionality is available when the app is running in Developer mode. This list will return empty if this is the case, but you will be able to access all functionality while the view displays a watermark.
        Returns:
        the licenses of the extensions
        Since:
        100.0.0