Dev Center
Table of contents

License Methods

Method Description
initLicense Initializes license key and activate the SDK.
getIdleInstancesCount Gets available instances count when charging by concurrent instances count.
setDeviceFriendlyName Sets a human-readable name that identifies the device.
initLicenseFromServer Deprecated
initLicenseFromLicenseContent Deprecated
outputLicenseToString Deprecated
initDLSConnectionParameters Deprecated
initLicenseFromDLS Deprecated
initLTSConnectionParameters Deprecated
initLicenseFromLTS Deprecated

initLicense

Initializes license key and activates the SDK.

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

Parameters

license The product keys.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader.initLicense("YOUR-LICENSE-KEY");
BarcodeReader reader = new BarcodeReader();
// add further process

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.

  • 0: There is no space for new instance
  • -1: The available count needs to be updated from server by calling initLicense.
  • N ( N > 0 ): N more instances can be created.

Code Snippet

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

setDeviceFriendlyName

Sets a human-readable name that identifies the device.

static void com.dynamsoft.dbr.BarcodeReader.setDeviceFriendlyName(String name) throws BarcodeReaderException

Parameters

name The device alias.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader.setDeviceFriendlyName("My-PC");
BarcodeReader.initLicense("YOUR-LICENSE-KEY");
BarcodeReader reader = new BarcodeReader();
// add further process

initLicenseFromServer

Deprecated. It still works in this version but could be removed in the near future.

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

initLicenseFromLicenseContent

Deprecated. It still works in this version but could be removed in the near future.

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

outputLicenseToString

Deprecated. It still works in this version but could be removed in the near future.

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

initDLSConnectionParameters

Deprecated. It still works in this version but could be removed in the near future.

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

initLicenseFromDLS

Deprecated. It still works in this version but could be removed in the near future.

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

initLTSConnectionParameters

Deprecated. It still works in this version but could be removed in the near future.

initLicenseFromLTS

Deprecated. It still works in this version but could be removed in the near future.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 9.4.0

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +