Table of contents

License Methods

Method Description
initLicense Reads product key and activate the SDK.
initLicenseFromServer Initializes license and connect to the specified server for online verification.
initLicenseFromLicenseContent Initializes license from the license content on client machine for offline verification.
outputLicenseToString Outputs the license content to a string from the license server.
initDLSConnectionParameters Initializes a DMDLSConnectionParameters struct with default values.
initLicenseFromDLS Initializes the barcode reader license and connects to the specified server for online verification.
getIdleInstancesCount Gets available instances count when charging by concurrent instances count.
initLTSConnectionParameters Deprecated. Use initDLSConnectionParameters instead.
initLicenseFromLTS Deprecated. Use initLicenseFromDLS instead.

initLicense

Reads product key and activates the SDK.

void com.dynamsoft.dbr.BarcodeReader.initLicense(String license) throws BarcodeReaderException

Parameters

license The product keys.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader();
reader.initLicense("t0260NwAAAHV***************");
reader.destroy();

initLicenseFromServer

Initializes the license and connects to the specified server for online verification.

void com.dynamsoft.dbr.BarcodeReader.initLicenseFromServer(String licenseServer, String licenseKey)	throws BarcodeReaderException

Parameters

licenseServer The URL of the license server.
licenseKey The license key.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.initLicenseFromServer("", "C087****");
reader.destroy();

initLicenseFromLicenseContent

Initializes barcode reader license from the license content on the client machine for offline verification.

void com.dynamsoft.dbr.BarcodeReader.initLicenseFromLicenseContent(String licenseKey, String licenseContent) throws BarcodeReaderException

Parameters

licenseKey The license key.
licenseContent An encrypted string representing the license content (quota, expiration date, barcode type, etc.) obtained from the method OutputLicenseToString.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.initLicenseFromLicenseContent("t0260NwAAAHV***************", "C087****");
reader.destroy();

outputLicenseToString

Outputs the license content as an encrypted string from the license server for offline license verification.

String com.dynamsoft.dbr.BarcodeReader.outputLicenseToString() throws BarcodeReaderException

Return Value

The output string which stores the content of the license.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.initLicenseFromLicenseContent("t0260NwAAAHV***************", "C087****");
String licenseInfo = reader.outputLicenseToString();
reader.destroy();

Remarks
InitLicenseFromServer has to be successfully called before calling this method.

initDLSConnectionParameters

Initializes a DMDLSConnectionParameters struct with default values.

static DMDLSConnectionParameters com.dynamsoft.dbr.BarcodeReader.initDLSConnectionParameters() throws BarcodeReaderException

Code Snippet

DMDLSConnectionParameters info = BarcodeReader.initDLSConnectionParameters();
info.handshakeCode = "*****-hs-****";
info.sessionPassword = "******";
BarcodeReader.initLicenseFromDLS(info);
BarcodeReader reader = new BarcodeReader();

initLicenseFromDLS

Initializes the barcode reader license and connects to the specified server for online verification.

static void com.dynamsoft.dbr.BarcodeReader.initLicenseFromDLS(DMDLSConnectionParameters dlsInfo) throws BarcodeReaderException

Parameters

dlsInfo: The struct DMDLSConnectionParameters with customized settings.

Code Snippet

DMDLSConnectionParameters info = BarcodeReader.initDLSConnectionParameters();
info.handshakeCode = "*****-hs-****";
info.sessionPassword = "******";
BarcodeReader.initLicenseFromDLS(info);
BarcodeReader reader = new BarcodeReader();

getIdleInstancesCount

Gets the count of available instances when charging by concurrent instances count.

static int com.dynamsoft.dbr.BarcodeReader.getIdleInstancesCount()

Return Value

Returns available instances count.

Code Snippet

//...
int count = BarcodeReader.getIdleInstancesCount();
if(count > 0)
{
  //create instance and process further
}
else 
{
  //waiting for available instances 
}

initLTSConnectionParameters

Deprecated. Use initDLSConnectionParameters instead.

initLicenseFromLTS

Deprecated. Use initLicenseFromDLS instead.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: