Dev Center
Table of contents

License Methods

Method Description
initLicense Initializes license key and activate the SDK.
isInstanceValid Gets whether the instance is valid when charging by concurrent instances count.
setDeviceFriendlyName Sets a human-readable name that identifies the device.
setMaxConcurrentInstanceCount Sets the max concurrent instance count used for current device and process.
getIdleInstancesCount Deprecated
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

isInstanceValid

Gets whether the instance is valid when charging by concurrent instances count.

int com.dynamsoft.dbr.BarcodeReader.isInstanceValid()

Return Value

Returns an int value indicating whether the instance is valid for running on concurrent instance mode.

  • 0: The instance is not valid for running on concurrent instance mode.
  • 1: The instance is valid for running on concurrent instance mode.

Remarks

This method is meaningful only when using a license charged by concurrent instances count.

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

setMaxConcurrentInstanceCount

Sets the max concurrent instance count used for current device and process.

static void com.dynamsoft.dbr.BarcodeReader.setMaxConcurrentInstanceCount(int countForThisDevice, int countForThisProcess)

Parameters

[in] countForThisDevice The maximum number of concurrent instances that the current device can run.

[in] countForThisProcess The maximum number of concurrent instances that the current process can run.

Code Snippet

int countForThisDevice = 1; // The count value should be set based on your purchased license count
int countForThisProcess = 1; // The count value should be set based on your purchased license count
BarcodeReader.setMaxConcurrentInstanceCount(countForThisDevice, countForThisProcess);
BarcodeReader.initLicense("YOUR-LICENSE-KEY");
BarcodeReader reader = BarcodeReader.getInstance();
// If no instance is available right away, the application will wait until one becomes available
if(reader != null)
{
    // Add your code here to call decoding method, process barcode results and so on
    // ...
    // Recycle the instance to make it idle for other concurrent tasks
    reader.recycle();
}

getIdleInstancesCount

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

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

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.6.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 +