# Print output for @column tags ?> Scanner | Android Developers

Most visited

Recently visited

Scanner

public class Scanner
extends Object

java.lang.Object
   ↳ com.vuzix.sdk.barcode.Scanner


This class is deprecated.
As of Scanner 2

Main entry point into the barcode scanning library. The library needs to be initialized once via the init() method. Then to perform a scan, simply call scan().

Summary

Public constructors

Scanner()

Public methods

static ScanResult[] convertToResults(ScanResult2[] inResult)
static void init(Context context, String licenseKey)

Initialize the barcode scanner with a custom license key.

static void init(Context context)

Initialize the barcode scanner with the default Vuzix license key.

static ScanResult[] scan(byte[] imageData, int width, int height, ScanningRect rect, BarcodeType... intypes)

Scans the supplied image data for the requested barcode types.

static ScanResult[] scan(byte[] imageData, int width, int height, ScanningRect rect)

Scans the supplied image data for barcodes.

static ScanResult[] scan(byte[] imageData, int width, int height)

Scans the supplied image data for barcodes.

Public constructors

Scanner

public Scanner ()

Public methods

convertToResults

public static ScanResult[] convertToResults (ScanResult2[] inResult)

Parameters
inResult ScanResult2

Returns
ScanResult[]

init

public static void init (Context context, 
                String licenseKey)

Initialize the barcode scanner with a custom license key. An invalid license key will result in an IllegalArgumentException. Note that barcode scanning can still take place, however results may be obfuscated.

Parameters
context Context: the Context using the barcode scanner

licenseKey String: the license key to use

Throws
IllegalArgumentException if the license key is not valid

init

public static void init (Context context)

Initialize the barcode scanner with the default Vuzix license key. The following barcode types will be fully functional:

  • QR and QR Micro
  • EAN (8 & 13)
  • UPC (A & E)
  • Data Matrix
  • Code 128

Attempts to use other barcode types are not supported and may result in obfuscated results.

Parameters
context Context: the Context using the barcode scanner

scan

public static ScanResult[] scan (byte[] imageData, 
                int width, 
                int height, 
                ScanningRect rect, 
                BarcodeType... intypes)

Scans the supplied image data for the requested barcode types. Only the supplied scanning rectangle will be scanned.

Parameters
imageData byte: gray-scale image data

width int: width in pixels of the image data

height int: height in pixels of the image data

rect ScanningRect: the scanning rectangle in which to look for barcodes, if null the entire image will be scanned

intypes BarcodeType: the barcode types that should be scanned for

Returns
ScanResult[] an array of ScanResult

scan

public static ScanResult[] scan (byte[] imageData, 
                int width, 
                int height, 
                ScanningRect rect)

Scans the supplied image data for barcodes. Only the supplied scanning rectangle will be scanned. If a custom license key was supplied via init(), all possible barcode types will be scanned for. Otherwise only Vuzix supported barcode types will be scanned for.

Parameters
imageData byte: gray-scale image data

width int: width in pixels of the image data

height int: height in pixels of the image data

rect ScanningRect: the scanning rectangle in which to look for barcodes, if null the entire image will be scanned

Returns
ScanResult[] an array of ScanResult

scan

public static ScanResult[] scan (byte[] imageData, 
                int width, 
                int height)

Scans the supplied image data for barcodes. The entire image will be scanned. If a custom license key was supplied via init(), all possible barcode types will be scanned for. Otherwise only Vuzix supported barcode types will be scanned for.

Parameters
imageData byte: gray-scale image data

width int: width in pixels of the image data

height int: height in pixels of the image data

Returns
ScanResult[] an array of ScanResult