Skip to content

Activating the SDK License

An activation code is required to use the Nix Universal SDK. The license determines:

  • Which device types are available for discovery and connection.
  • Which features and data types are available for connected devices.

By default, all Nix device operations are disabled. It is necessary to activate the license before these are made available to the host application.

Obtaining a license key

Free evaluation codes are available for non-commercial use. To obtain an activation code, visit to the SDK license page.

Using the License Manager

License operations are handled via LicenseManager.Shared (see Kotlin or Java APIs).

Activating the license

A license is activated by calling LicenseManager.Shared.activate() (see Kotlin or Java). This method takes the license options and signature strings as arguments and returns the activation result as a LicenseManagerState value (see Kotlin or Java).

Note

License activations remain valid within a single session, but do not persist across different application launches. Therefore, it is required to call activate() at least once per session.

// Application context, in a Fragment use getContext()
val context: Context = applicationContext

// Update these string values to match your provided license
val options = "REPLACE_WITH_LICENSE_OPTIONS"
val signature = "REPLACE_WITH_LICENSE_SIGNATURE"

// Result is returned as a `LicenseManagerState` enum
val activationState = LicenseManager.activate(
    context = context,
    options = options,
    signature = signature)
// Application context, in a Fragment use getContext()
Context context = getApplicationContext();

// Update these string values to match your provided license
String options = "REPLACE_WITH_LICENSE_OPTIONS";
String signature = "REPLACE_WITH_LICENSE_SIGNATURE";

// Result is returned as a `LicenseManagerState` enum
LicenseManagerState activationState = LicenseManager.Shared.activate(
    context, 
    options, 
    signature);

Tip

The license manager state can also be checked at any time via: LicenseManager.Shared.getState() (see Kotlin or Java).

Device operations are only available if the resulting state is equal to LicenseManagerState/ACTIVE. All other values indicate an error state. Refer to the LicenseManagerState Kotlin or Java API documentation for further details.

Warning

You can switch licenses by calling activate() repeated times within a single session. Doing so will invalidate any open device connections. Any connected Nix devices will need to be disconnected and discovered again using a DeviceScanner after switching licenses.

Other license properties

Additional license properties can be queried on LicenseManager.Shared. Note that some properties may be blank or empty depending on your license capabilities.

Next steps