Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

License Methods

Method Description
initLicense Initializes license key and activate the SDK.
getDeviceUUID Gets the device uuid used for license activating.
isInstanceValid Gets whether the instance is valid when charging by concurrent instances count.
setDeviceFriendlyName Sets a human-readable name that identifies the device.
setLicenseCachePath Sets a directory path for saving the license cache.
setMaxConcurrentInstanceCount Sets the max concurrent instance count used for current device and process.
getInstancePoolStatus Gets a class to represent the status of an instance pool.
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 = BarcodeReader.getInstance();
if(reader != null)
{
    // add further process
    reader.recycle();
}

getDeviceUUID

Gets the device uuid used for license activating.

static String com.dynamsoft.dbr.BarcodeReader.getDeviceUUID(int uuidGenerationMethod) throws BarcodeReaderException

Parameters

uuidGenerationMethod The method used to generate the UUID.

  • 1: Generates UUID with random values.
  • 2: Generates UUID based on hardware info.

Exception

BarcodeReaderException

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 = BarcodeReader.getInstance();
if(reader != null)
{
    // add further process
    reader.recycle();
}

setLicenseCachePath

Sets a directory path for saving the license cache.

static void com.dynamsoft.dbr.BarcodeReader.setLicenseCachePath(String directoryPath) throws BarcodeReaderException

Parameters

directoryPath The directory path where to save the license cache.

Exception

BarcodeReaderException

Code Snippet

BarcodeReader.setLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE");
BarcodeReader.initLicense("YOUR-LICENSE-KEY");
BarcodeReader reader = BarcodeReader.getInstance();
if(reader != null)
{
    // add further process
    reader.recycle();
}

setMaxConcurrentInstanceCount

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

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

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.

[in] timeout The maximum time (in milliseconds) to wait for an available authorization or instance when calling initLicense, getInstance, or decode functions.

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();
}

getInstancePoolStatus

Gets a class to represent the status of an instance pool.

static InstancePoolStatus com.dynamsoft.dbr.BarcodeReader.getInstancePoolStatus() throws BarcodeReaderException

Return Value

Returns the InstancePoolStatus class representing the status of an instance pool.

Exception

BarcodeReaderException

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:

latest version

  • Latest version
  • Version 10.x
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • 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 +