SDK Initialization
The SDK behaves as a singleton - this means you initialize the SDK only once and use it many times. As soon as you initialize the SDK, it will contact the LicenseSpring server to check if there is an existing license for the current computer / product combination.
If there is a current license available, it will be immediately accessible as a License object.
At the minimum there are three parameters you will need to initialize the SDK:
- apiKey, your company API key
- productCode, a two-letter string identifying product (particular application)
- sharedKey, company-specific encryption key, used when signing requests
All of these values are available to you in the LicenseSpring web platform under "SDK integration" section.
LicenseManager takes two arguments for initialization, LicenseSpringConfiguration and application context. Application context is used for saving license files to internal app storage.
During initialization the LicenseManager will try to read the license information from specified license file and check the license information with the license server. In case it succeeds LicenseManager.getCurrent() will return License object with detailed license information specified.
The SDK has a hardware key generator based on the Secure Android ID. If the Secure Android ID is null, UUID will be used as a hardware key.