Class ScanbotSDK

java.lang.Object
io.scanbot.sdk.ScanbotSDK

public class ScanbotSDK extends Object
The class is responsible for initializing the Scanbot SDK functionality and managing global SDK settings.
  • Constructor Details

    • ScanbotSDK

      public ScanbotSDK()
  • Method Details

    • initialize

      public static void initialize(String licenceKey, String writablePath) throws IOException, LicenseException
      Initializes the Scanbot SDK with the given license key. Should be called before creating any other SDK objects.
      Parameters:
      licenceKey - The license key that was provided to you.
      writablePath - The path to a writable directory where the SDK can store temporary files.
      Throws:
      IOException - If an io operation on writable path failed.
      LicenseException - If failed to initialize the SDK with the given license key.
    • deregisterDevice

      public static void deregisterDevice()
      Effectively notifies the server that the license is no longer used by this device. After calling the method SDK behaves like no license is available. You should call this method if you are using floating license to notify the server that the device is no longer using the license and so another device can use it. If you are using a floating license, but you do not call this method, the license will be released automatically after a period specified in the license. If during work with the SDK you initialize the SDK with multiple licenses, there is no need to call the function after finishing work with each of the licenses, only with the last one. For others, the function is implicitly called automatically. The function returns immediately, but the deregistration process may take some time. You can use DeviceSession helper class to use this method in a try-with-resources statement.
    • waitForDeviceDeregistrationCompletion

      public static void waitForDeviceDeregistrationCompletion(int timeoutMs) throws TimeoutException
      Wait for the completion of the all device deregistration processes. Returns immediately if there's no deregistration in progress. See deregisterDevice().
      Parameters:
      timeoutMs - Timeout in milliseconds to wait for the device deregistration.
      Throws:
      TimeoutException - If the device deregistration did not complete within the given timeout.
    • getLicenseInfo

      public static LicenseInfo getLicenseInfo()
      Returns the current license info.
      Returns:
      The current license info.
    • setLogging

      public static void setLogging(boolean enable)
      Sets the logging state of the SDK.
      Parameters:
      enable - If true, the SDK will log messages to the console.
    • waitForOnlineLicenseCheckCompletion

      public static void waitForOnlineLicenseCheckCompletion(int timeoutMs) throws TimeoutException
      Wait for the completion of the online license check. Returns immediately if there's no online license check in progress.
      Parameters:
      timeoutMs - : Timeout in milliseconds
      Throws:
      TimeoutException - if the online license check did not complete within the given timeout