Class License
- java.lang.Object
-
- com.esri.arcgisruntime.License
-
public final class License extends java.lang.Object
Provides methods to manage the license of the ArcGIS Runtime. For an overview, see License and deployment in either ArcGIS Runtime API for Android or ArcGIS Runtime API for Java.An application runs in developer mode (
LicenseLevel.DEVELOPER
) until it is licensed. All functionality is available, but theGeoView
is watermarked. To turn off the watermark, a deployed application must run withLicenseLevel.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 currentLicenseLevel
will throw anArcGISRuntimeException
. See Licensing details by class to see which classes and methods are included in eachLicenseLevel
.To get
LITE
,BASIC
,STANDARD
, orADVANCED
level functionality, a user app is licensed in one of two ways:
- With license information retrieved after logging in to a portal (LITE and BASIC levels).
- With a license string acquired from the ArcGIS for Developers website or Esri Customer Service.
To license with a license string, call
ArcGISRuntimeEnvironment.setLicense(String)
. You can obtain a license string by going to the ArcGIS for Developers website. Go to either ArcGIS Runtime API for Android or ArcGIS Runtime API for Java Alternatively, you can contact Esri Customer Service.To validate with information from a portal, you need a
LicenseInfo
instance. This can be obtained by callingPortal.fetchLicenseInfoAsync()
. Pass the LicenseInfo toArcGISRuntimeEnvironment.setLicense(LicenseInfo)
.Both these
setLicense
methods return aLicenseResult
indicating whether or not the license is valid.Note
A license that is set usingLicenseInfo
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) CallingArcGISRuntimeEnvironment.setLicense(LicenseInfo)
returns aLicenseResult
in which theLicenseResult.getLicenseStatus()
isLicenseStatus.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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Calendar
getExpiry()
Returns the expiry date and time in UTC of a license set withArcGISRuntimeEnvironment.setLicense(String)
, or the portal subscription expiry when usingArcGISRuntimeEnvironment.setLicense(LicenseInfo)
.java.util.List<ExtensionLicense>
getExtensions()
Returns a list of extension licenses that were applied to the app.LicenseLevel
getLicenseLevel()
Gets the current license level set in the application.LicenseStatus
getLicenseStatus()
Returns the license status for the current license applied to the app.LicenseType
getLicenseType()
Returns current license type for license applied to the app.boolean
isPermanent()
Returns true if extension license is permanent; false otherwise.
-
-
-
Method Detail
-
getLicenseLevel
public LicenseLevel getLicenseLevel()
Gets the current license level set in the application. The current license level will be one of the following values from theLicenseLevel
enum:DEVELOPER
,LITE
,BASIC
,STANDARD
, orADVANCED
.By default, when an app is launched it runs at the
LicenseLevel.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 withLicenseLevel.LITE
and can upgrade toLicenseLevel.BASIC
or higher. Also note that we cannot downgrade the license level for an app once theLicenseLevel
is set.- Returns:
- the current license level
- Since:
- 100.0.0
-
getExpiry
public java.util.Calendar getExpiry()
Returns the expiry date and time in UTC of a license set withArcGISRuntimeEnvironment.setLicense(String)
, or the portal subscription expiry when usingArcGISRuntimeEnvironment.setLicense(LicenseInfo)
.- Returns:
- the expiry date of the current license
- Since:
- 100.0.0
-
isPermanent
public boolean isPermanent()
Returns true if extension license is permanent; false otherwise. Most extension license strings do not expire. Typically, this returns true for a license string with 'none' in the expiration date field.- 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 returnsLicenseStatus.VALID
because the currentLicense
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 current license type for license applied to the app. In developer mode, this method returnsLicenseType.DEVELOPER
. Otherwise, it returnsLicenseType.NAMED_USER
if the app was licensed by logging in to a portal and acquiringLicenseInfo
, orLicenseType.LICENSE_KEY
if the app was licensed from a license string. The license type can change while an app runs. For instance, the app might initially set the license with a license string (type would beLICENSE_KEY
) and later re-set the license with aLicenseInfo
object (type would beNAMED_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 strings supplied when calling
ArcGISRuntimeEnvironment.setLicense(String, List)
, this list is populated with information about the extension licenses. Use this function to iterate through extension licenses available for the app.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
-
-