public static class

ArcGISRuntime.License

extends Object
java.lang.Object
   ↳ com.esri.android.runtime.ArcGISRuntime.License

Class Overview

Runtime core licensing functionality.

An application will run in developer mode until it is licensed (LicenseLevel.Developer). All functionality will be available but the map display will be watermarked and the APIs will log messages stating that the application is in developer mode. A deployed application needs to be run with the basic license level to turn off the map watermark. The basic license level is set by calling setClientId(String) with a client ID from ArcGIS Online or a portal. With basic licensing set, a subset of functionality will be available.

To get full functionality, a user application can be licensed in one of two ways: with license information retrieved after logging in to a portal or with a license string as used with ArcGIS Desktop. To license with a license string, simply call setLicense(String). To validate with information from a portal, you will need a LicenseInfo instance. This can be obtained by calling getLicenseInfo(). Pass the LicenseInfo to setLicense(LicenseInfo). Both of these methods will return a LicenseResult indicating whether or not the license is valid. Note that there is a 30 day timeout when using LicenseInfo: if the application is licensed using this method, the user will be required to log into the portal again before licensing the application. When this period has expired, calling setLicense(LicenseInfo) will return LicenseResult.LoginRequired and the application will be in basic mode.

Summary

Public Constructors
ArcGISRuntime.License()
Public Methods
static Date getExpiry()
This method will return either the expiry date of a license set with setLicense(String) or the portal subscription expiry when using setLicense(LicenseInfo).
static LicenseLevel getLicenseLevel()
Get the current license level set in the application.
static LicenseResult setLicense(String licenseString)
License an application for standard functionality using a standard ESRI license string.
static LicenseResult setLicense(LicenseInfo licenseInfo)
License an application for standard functionality using a LicenseInfo instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ArcGISRuntime.License ()

Public Methods

public static Date getExpiry ()

This method will return either the expiry date of a license set with setLicense(String) or the portal subscription expiry when using setLicense(LicenseInfo).

Returns
Date the expiry date of the current license

public static LicenseLevel getLicenseLevel ()

Get the current license level set in the application.

Returns
LicenseLevel the current license level: Developer, Basic or Standard

public static LicenseResult setLicense (String licenseString)

License an application for standard functionality using a standard ESRI license string. This method will return either Valid, Invalid or Expired.

Parameters
licenseString String: standard ESRI license string
Returns
LicenseResult whether or not the license is valid

public static LicenseResult setLicense (LicenseInfo licenseInfo)

License an application for standard functionality using a LicenseInfo instance. A LicenseInfo can be obtained from a portal for the current logged in user by calling getLicenseInfo(). 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 either Valid, Invalid, Expired (if the user's subscription on the portal has expired) or LoginRequired if the LicenseInfo has expired.

Parameters
licenseInfo LicenseInfo: license information from a portal
Returns
LicenseResult whether or not the license is valid