MENU
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.

Android API Reference - BarcodeReader License Methods

Method Description
initLicense Read product key and activate the SDK.
initLicenseFromServer Initialize license and connect to the specified server for online verification.
initLicenseFromLicenseContent Initialize license from the license content on client machine for offline verification.
outputLicenseToString Output the license content to a string from the license server.
initLicenseFromLTS Initializes the barcode reader license and connects to the specified server for online verification.

initLicense

Read product key and activate the SDK.

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

Parameters

license: The product keys.

Exceptions

BarcodeReaderException

Code Snippet

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

initLicenseFromServer

Initialize the license and connect to the specified server for online verification.

void com.dynamsoft.dbr.BarcodeReader.initLicenseFromServer(String licenseServer, String licenseKey, DBRServerLicenseVerificationListener dbrServerLicenseVerificationListener)

Parameters

  • licenseServer: The URL of the license server.
  • licenseKey: The license key.
  • dbrServerLicenseVerificationListener: The delegate to handle callback when license server returns.

Code Snippet

BarcodeReader reader = new BarcodeReader("t0260NwAAAHV***************");
reader.initLicenseFromServer("", "C087****",  new DBRServerLicenseVerificationListener() {
    @Override
    public void licenseVerificationCallback(boolean isSuccess, Exception error) {
    }
});
reader.destroy();

initLicenseFromLicenseContent

Initialize 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.

Exceptions

BarcodeReaderException

Code Snippet

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

outputLicenseToString

Output the license content as an encrypted string from the license server to be used for offline license verification.

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

Return value

The output string which stores the contents of license.

Exceptions

BarcodeReaderException

Remark

InitLicenseFromServer has to be successfully called before calling this method.

Code Snippet

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

initLicenseFromLTS

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

void com.dynamsoft.dbr.BarcodeReader.initLicenseFromLTS(DMLTSConnectionParameters ltsInfo, DBRLTSLicenseVerificationListener listener)

Parameters

  • ltsInfo: The struct DMLTSConnectionParameters with customized settings.
  • listener: The delegate to handle callback when license server returns.

Code Snippet

BarcodeReader reader = new BarcodeReader();
DMLTSConnectionParameters info = new DMLTSConnectionParameters();
info.handShakeCode = "*****-hs-****";
info.sessionPassword = "******";
reader.initLicenseFromLTS(info, new DBRLTSLicenseVerificationListener() {
   @Override
   public void LTSLicenseVerificationCallback(boolean b, Exception e) {
      if (!b && e != null) {
         e.printStackTrace();
      }
   }
}

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest Version
  • version 7.6
  • version 7.5
Change +
© 2003–2020 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support