Barcode Scanner SDK
Barcode decoder library
com.manateeworks.BarcodeScanner Class Reference

Represents a static BarcodeScanner class with native decoder. More...

Classes

class  MWLocation
 Represents MWLocation object for storing barcode edge points (x,y) of successfully decoded barcode on image/frame.
 
class  MWResult
 Represents MWResult object for storing result properties and data of successfully decoded barcode.
 
class  MWResults
 Represents MWResults object for storing one or multiple MWResult object(s).
 

Static Public Member Functions

static native int MWBgetLibVersion ()
 Returns version code of Barcode Scanner Library. More...
 
static native String MWBgetLibVersionText ()
 
static native int MWBgetSupportedCodes ()
 Returns supported decoders in this library release. More...
 
static native int MWBsetScanningRect (int codeMask, float left, float top, float width, float height)
 Sets rectangular area for barcode scanning with selected single decoder type. More...
 
static native int MWBsetTargetRect (float left, float top, float width, float height)
 Sets rectangular area for targeted barcode scanning. More...
 
static native float[] MWBgetScanningRectArray (int codeMask)
 Get rectangular area for barcode scanning with selected single or multiple decoder type(s). More...
 
static native float[] MWBgetTargetRectArray ()
 Get rectangular area for targeted scanning Output values are in percentages of screeen width and height (range 0 - 100) More...
 
static native int MWBregisterSDK (String key, Activity activity)
 Registers licensing information for all SDK functionality. More...
 
static native int MWBregisterSDK (String key, Context context)
 Registers licensing information for all SDK functionality. More...
 
static native int MWBregisterSDKCustom (String key, String customData, Context context)
 Same as RegisterSDK with addition of custom string to be sent along with tracking info. More...
 
static native String MWBgetDeviceID ()
 Get device ID. More...
 
static native String MWBgetLicenseString ()
 Get license string for retrieving remaining devices It should be called after registering call, and works only on iOS and Android. More...
 
static native int MWBsetActiveCodes (int codeMask)
 Sets active or inactive status of decoder types and updates decoder execution priority list. More...
 
static native int MWBgetActiveCodes ()
 Get active decoder types. More...
 
static native int MWBsetActiveSubcodes (int codeMask, int subMask)
 Set active subcodes for given code group flag. More...
 
static native int MWBgetActiveSubcodes (int codeMask)
 Get active subcodes for given code group flag. More...
 
static native int MWBenableCode (int codeMask)
 Enable decoder type. More...
 
static native int MWBdisableCode (int codeMask)
 Disable decoder type Remove barcode type from set of enabled types. More...
 
static native int MWBenableSubcode (int codeMask, int subMask)
 Enable subcode for given code group flag. More...
 
static native int MWBdisableSubcode (int codeMask, int subMask)
 Disable subcode for given code group flag. More...
 
static native int MWBcleanupLib ()
 Free memory resources allocated by library. More...
 
static native int MWBgetLastType ()
 Retrieves actual detected code type after successful MWB_scanGrayscaleImage call. More...
 
static native int MWBisLastGS1 ()
 Retrieves is result of GS1 type. More...
 
static native byte[] MWBscanGrayscaleImage (byte[] gray, int width, int height)
 Main scan function. More...
 
static native byte[] MWBscanByteBuffer (ByteBuffer gray, int width, int height)
 
static native int MWBsetFlags (int codeMask, int flags)
 Configure options for single barcode type. More...
 
static native int MWBgetFlags (int codeMask)
 Get active flags for single barcode type. More...
 
static native int MWBenableFlag (int codeMask, int flag)
 Enable option for single barcode type (or global one). More...
 
static native int MWBdisableFlag (int codeMask, int flag)
 Disable option for single barcode type (or global one). More...
 
static native int MWBsetParam (int codeMask, int paramId, int paramValue)
 Set custom decoder param. More...
 
static native int MWBgetParam (int codeMask, int paramId)
 Get specified decoder param. More...
 
static native int MWBsetLevel (int level)
 Configure global library effort level Barcode detector relies on image processing and geometry interpolation for extracting optimal data for decoding. More...
 
static native int MWBsetDirection (int direction)
 Configure scanning direction for 1D barcodes. More...
 
static native int MWBgetDirection ()
 Get active scanning direction. More...
 
static native int MWBvalidateVIN (byte[] vin)
 Checks if the input is a valid Vehicle Identification Number. More...
 
static native float[] MWBgetBarcodeLocation ()
 Barcode location points. More...
 
static native int MWBsetResultType (int resultType)
 Set result type from MWB_scanGrayscaleImage Users now can choose between getting raw result bytes as a result of image scan, or byte representation of complex result structure containing all information about the scanned barcode. More...
 
static native int MWBgetResultType ()
 Get currently active result type. More...
 
static native int MWBsetMinLength (int codeMask, int minLength)
 Set minimum result length for single barcode type. More...
 
static native int MWBsetDuplicatesTimeout (int timeout)
 Set time in seconds in which decoder will ignore same barcode detected. More...
 
static native void MWBsetDuplicate (byte[] barcode, int length)
 Set the decoded barcode result to be checked as duplicate. More...
 
static native int[] MWBcropPreviewFrame (byte[] previewBuffer, int width, int height, int newSize)
 For use with StingRay. More...
 
static int MWBsetScanningRect (int codeMask, Rect rect)
 Sets rectangular area for barcode scanning with selected single decoder type. More...
 
static int MWBsetTargetRect (Rect rect)
 
static RectF MWBgetScanningRect (int codeMask)
 Get rectangular area for barcode scanning with selected single or multiple decoder type(s). More...
 
static RectF MWBgetTargetRect ()
 Get rectangular area for targeted scanning Output values are in percentages of screeen width and height (range 0 - 100) More...
 

Static Public Attributes

static final int MWB_RT_OK = 0
 Basic return values for API functions.
 
static final int MWB_RT_FAIL = -1
 
static final int MWB_RT_NOT_SUPPORTED = -2
 
static final int MWB_RT_BAD_PARAM = -3
 
static final int MWB_RTREG_OK = 0
 Basic return values for RegisterSDK function.
 
static final int MWB_RTREG_INVALID_KEY = -1
 
static final int MWB_RTREG_INVALID_CHECKSUM = -2
 
static final int MWB_RTREG_INVALID_APPLICATION = -3
 
static final int MWB_RTREG_INVALID_SDK_VERSION = -4
 
static final int MWB_RTREG_INVALID_KEY_VERSION = -5
 
static final int MWB_RTREG_INVALID_PLATFORM = -6
 
static final int MWB_RTREG_KEY_EXPIRED = -7
 
static final int MWB_RTREG_REGISTERING_IN_PROGRESS = -8
 
static final int MWB_RTREG_CUSTOM_SIZE_EXCEEDED = -100
 
static final int MWB_CFG_CODE39_REQUIRE_CHECKSUM = 0x2
 Code39 decoder flags value: require checksum check.
 
static final int MWB_CFG_CODE39_DONT_REQUIRE_STOP = 0x4
 Code39 decoder flags value: don't require stop symbol - can lead to false results.
 
static final int MWB_CFG_CODE39_EXTENDED_MODE = 0x8
 Code39 decoder flags value: decode full ASCII.
 
static final int MWB_CFG_CODE39_CODE32_ENABLED = 0x10
 Code39 decoder flags value: Try decoding result to CODE32. More...
 
static final int MWB_CFG_CODE39_CODE32_PREFIX = 0x20
 Code39 decoder flags value: ADD 'A' prefix to Code32 result.
 
static final int MWB_CFG_CODE93_EXTENDED_MODE = 0x8
 Code93 decoder flags value: decode full ASCII.
 
static final int MWB_CFG_EANUPC_DISABLE_ADDON = 0x1
 UPC/EAN decoder disable addons detection.
 
static final int MWB_CFG_EANUPC_DONT_EXPAND_UPCE = 0x2
 UPC/EAN disable UPC-E expanding to UPC-A.
 
static final int MWB_CFG_CODE25_REQ_CHKSUM = 0x1
 Code25 decoder flags value: require checksum check MWB_CFG_CODE25_REQ_CHKSUM is deprecated and shouldn't be used in combination with other checksum flags.
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_STANDARD = 0x02
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_INTERLEAVED = 0x04
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_IATA = 0x08
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_MATRIX = 0x10
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_COOP = 0x20
 
static final int MWB_CFG_CODE25_REQ_CHKSUM_INVERTED = 0x40
 
static final int MWB_CFG_TELEPEN_FORCE_NUMERIC = 0x1
 Telepen decoder flags.
 
static final int MWB_CFG_CODE11_REQ_SINGLE_CHKSUM = 0x1
 Code11 decoder flags value: require checksum check MWB_CFG_CODE11_REQ_SINGLE_CHKSUM is set by default.
 
static final int MWB_CFG_CODE11_REQ_DOUBLE_CHKSUM = 0x2
 
static final int MWB_CFG_MSI_REQ_10_CHKSUM = 0x01
 MSI Plessey decoder flags value: require checksum check MWB_CFG_MSI_REQ_10_CHKSUM is set by default.
 
static final int MWB_CFG_MSI_REQ_1010_CHKSUM = 0x02
 
static final int MWB_CFG_MSI_REQ_11_IBM_CHKSUM = 0x04
 
static final int MWB_CFG_MSI_REQ_11_NCR_CHKSUM = 0x08
 
static final int MWB_CFG_MSI_REQ_1110_IBM_CHKSUM = 0x10
 
static final int MWB_CFG_MSI_REQ_1110_NCR_CHKSUM = 0x20
 
static final int MWB_CFG_CODABAR_INCLUDE_STARTSTOP = 0x1
 Codabar decoder flags value: include start/stop symbols in result.
 
static final int MWB_CFG_GLOBAL_HORIZONTAL_SHARPENING = 0x01
 Global decoder flags value: apply sharpening on input image.
 
static final int MWB_CFG_GLOBAL_VERTICAL_SHARPENING = 0x02
 
static final int MWB_CFG_GLOBAL_SHARPENING = 0x03
 
static final int MWB_CFG_GLOBAL_ROTATE90 = 0x04
 Global decoder flags value: apply rotation on input image.
 
static final int MWB_CFG_GLOBAL_ROTATE180 = 0x08
 
static final int MWB_CFG_GLOBAL_CALCULATE_1D_LOCATION = 0x10
 Global decoder flags value: calculate location for 1D barcodeTypes (Code128, Code93, Code39 supported)
 
static final int MWB_CFG_GLOBAL_VERIFY_1D_LOCATION = 0x20
 Global decoder flags value: fail 1D decode if result is not confirmed by location expanding (Code128, Code93, Code39 supported)
 
static final int MWB_CFG_GLOBAL_USE_CENTRIC_SCANNING = 0x40
 Global decoder flags value: fail decode if result is not touching the center of viewfinder (2D + Code128, Code93, Code39 supported) 1D location flags will be enabled automatically with this one.
 
static final int MWB_CFG_GLOBAL_DISABLE_PREPROCESSING = 0x80
 Global decoder flags value: disable some image pre=processing, suitable for devices with weak CPU.
 
static final int MWB_CFG_GLOBAL_ENABLE_MULTI = 0x100
 Global decoder flags value: enable multi code scanning.
 
static final int MWB_CODE_MASK_NONE = 0x00000000
 Bit mask identifiers for supported decoder types.
 
static final int MWB_CODE_MASK_QR = 0x00000001
 
static final int MWB_CODE_MASK_DM = 0x00000002
 
static final int MWB_CODE_MASK_RSS = 0x00000004
 
static final int MWB_CODE_MASK_39 = 0x00000008
 
static final int MWB_CODE_MASK_EANUPC = 0x00000010
 
static final int MWB_CODE_MASK_128 = 0x00000020
 
static final int MWB_CODE_MASK_PDF = 0x00000040
 
static final int MWB_CODE_MASK_AZTEC = 0x00000080
 
static final int MWB_CODE_MASK_25 = 0x00000100
 
static final int MWB_CODE_MASK_93 = 0x00000200
 
static final int MWB_CODE_MASK_CODABAR = 0x00000400
 
static final int MWB_CODE_MASK_DOTCODE = 0x00000800
 
static final int MWB_CODE_MASK_11 = 0x00001000
 
static final int MWB_CODE_MASK_MSI = 0x00002000
 
static final int MWB_CODE_MASK_MAXICODE = 0x00004000
 
static final int MWB_CODE_MASK_POSTAL = 0x00008000
 
static final int MWB_CODE_MASK_TELEPEN = 0x00010000
 
static final int MWB_CODE_MASK_ALL = 0xffffffff
 
static final int MWB_SUBC_MASK_RSS_14 = 0x00000001
 Bit mask identifiers for RSS decoder types.
 
static final int MWB_SUBC_MASK_RSS_LIM = 0x00000004
 
static final int MWB_SUBC_MASK_RSS_EXP = 0x00000008
 
static final int MWB_SUBC_MASK_QR_STANDARD = 0x00000001
 Bit mask identifiers for QR decoder types.
 
static final int MWB_SUBC_MASK_QR_MICRO = 0x00000002
 
static final int MWB_SUBC_MASK_PDF_STANDARD = 0x00000001
 Bit mask identifiers for PDF decoder types.
 
static final int MWB_SUBC_MASK_PDF_MICRO = 0x00000002
 
static final int MWB_SUBC_MASK_C25_INTERLEAVED = 0x00000001
 Bit mask identifiers for Code 2 of 5 decoder types.
 
static final int MWB_SUBC_MASK_C25_STANDARD = 0x00000002
 
static final int MWB_SUBC_MASK_C25_ITF14 = 0x00000004
 
static final int MWB_SUBC_MASK_C25_IATA = 0x00000008
 
static final int MWB_SUBC_MASK_C25_MATRIX = 0x00000010
 
static final int MWB_SUBC_MASK_C25_COOP = 0x00000020
 
static final int MWB_SUBC_MASK_C25_INVERTED = 0x00000040
 
static final int MWB_SUBC_MASK_POSTAL_POSTNET = 0x00000001
 Bit mask identifiers for POSTAL decoder types.
 
static final int MWB_SUBC_MASK_POSTAL_PLANET = 0x00000002
 
static final int MWB_SUBC_MASK_POSTAL_IM = 0x00000004
 
static final int MWB_SUBC_MASK_POSTAL_ROYAL = 0x00000008
 
static final int MWB_SUBC_MASK_POSTAL_AUSTRALIAN =0x00000010
 
static final int MWB_SUBC_MASK_EANUPC_EAN_13 = 0x00000001
 Bit mask identifiers for UPC/EAN decoder types.
 
static final int MWB_SUBC_MASK_EANUPC_EAN_8 = 0x00000002
 
static final int MWB_SUBC_MASK_EANUPC_UPC_A = 0x00000004
 
static final int MWB_SUBC_MASK_EANUPC_UPC_E = 0x00000008
 
static final int MWB_SUBC_MASK_EANUPC_UPC_E1 = 0x00000010
 
static final int MWB_SCANDIRECTION_HORIZONTAL = 0x00000001
 Bit mask identifiers for 1D scanning direction.
 
static final int MWB_SCANDIRECTION_VERTICAL = 0x00000002
 
static final int MWB_SCANDIRECTION_OMNI = 0x00000004
 
static final int MWB_SCANDIRECTION_AUTODETECT = 0x00000008
 
static final int FOUND_NONE = 0
 Result values for all code types.
 
static final int FOUND_DM = 1
 
static final int FOUND_39 = 2
 
static final int FOUND_RSS_14 = 3
 
static final int FOUND_RSS_14_STACK = 4
 
static final int FOUND_RSS_LIM = 5
 
static final int FOUND_RSS_EXP = 6
 
static final int FOUND_EAN_13 = 7
 
static final int FOUND_EAN_8 = 8
 
static final int FOUND_UPC_A = 9
 
static final int FOUND_UPC_E = 10
 
static final int FOUND_128 = 11
 
static final int FOUND_PDF = 12
 
static final int FOUND_QR = 13
 
static final int FOUND_AZTEC = 14
 
static final int FOUND_25_INTERLEAVED = 15
 
static final int FOUND_25_STANDARD = 16
 
static final int FOUND_93 = 17
 
static final int FOUND_CODABAR = 18
 
static final int FOUND_DOTCODE = 19
 
static final int FOUND_128_GS1 = 20
 
static final int FOUND_ITF14 = 21
 
static final int FOUND_11 = 22
 
static final int FOUND_MSI = 23
 
static final int FOUND_25_IATA = 24
 
static final int FOUND_25_MATRIX = 25
 
static final int FOUND_25_COOP = 26
 
static final int FOUND_25_INVERTED = 27
 
static final int FOUND_QR_MICRO = 28
 
static final int FOUND_MAXICODE = 29
 
static final int FOUND_POSTNET = 30
 
static final int FOUND_PLANET = 31
 
static final int FOUND_IMB = 32
 
static final int FOUND_ROYALMAIL = 33
 
static final int FOUND_MICRO_PDF = 34
 
static final int FOUND_32 = 35
 
static final int FOUND_AUSTRALIAN = 36
 
static final int FOUND_TELEPEN = 37
 
static final int MWB_RESULT_TYPE_RAW = 0x00000001
 Result structure constants. More...
 
static final int MWB_RESULT_TYPE_MW = 0x00000002
 
static final int MWB_PAR_ID_ECI_MODE = 0x08
 Barcode decoder param types.
 
static final int MWB_PAR_ID_RESULT_PREFIX = 0x10
 
static final int MWB_PAR_ID_VERIFY_LOCATION = 0x20
 
static final int MWB_PAR_ID_SCAN_COLOR = 0x40
 
static final int MWB_PAR_ID_SAFE_ZONE_SCALE = 0x80
 
static final int MWB_PAR_VALUE_ECI_DISABLED = 0x00
 Barcode param values.
 
static final int MWB_PAR_VALUE_ECI_ENABLED = 0x01
 
static final int MWB_PAR_VALUE_RESULT_PREFIX_NEVER = 0x00
 
static final int MWB_PAR_VALUE_RESULT_PREFIX_ALWAYS = 0x01
 
static final int MWB_PAR_VALUE_RESULT_PREFIX_DEFAULT = 0x02
 
static final int MWB_PAR_VALUE_VERIFY_LOCATION_OFF = 0x00
 
static final int MWB_PAR_VALUE_VERIFY_LOCATION_ON = 0x01
 
static final int MWB_RESULT_FT_BYTES = 0x00000001
 Identifiers for result fields types.
 
static final int MWB_RESULT_FT_TEXT = 0x00000002
 
static final int MWB_RESULT_FT_TYPE = 0x00000003
 
static final int MWB_RESULT_FT_SUBTYPE = 0x00000004
 
static final int MWB_RESULT_FT_SUCCESS = 0x00000005
 
static final int MWB_RESULT_FT_ISGS1 = 0x00000006
 
static final int MWB_RESULT_FT_LOCATION = 0x00000007
 
static final int MWB_RESULT_FT_IMAGE_WIDTH = 0x00000008
 
static final int MWB_RESULT_FT_IMAGE_HEIGHT = 0x00000009
 
static final int MWB_RESULT_FT_PARSER_BYTES = 0x0000000A
 
static final int MWB_RESULT_FT_MODULES_COUNT_X = 0x0000000B
 
static final int MWB_RESULT_FT_MODULES_COUNT_Y = 0x0000000C
 
static final int MWB_RESULT_FT_MODULE_SIZE_X = 0x0000000D
 
static final int MWB_RESULT_FT_MODULE_SIZE_Y = 0x0000000E
 
static final int MWB_RESULT_FT_SKEW = 0x0000000F
 
static final int MWB_RESULT_FT_KANJI = 0x00000010
 
static final int MWB_RESULT_FT_BARCODE_WIDTH = 0x00000011
 
static final int MWB_RESULT_FT_BARCODE_HEIGHT = 0x00000012
 
static final int MWB_RESULT_FT_TEXT_ENCODING = 0x00000013
 
static final int MWB_RESULT_FT_PDF_ROWS = 0x00000020
 
static final int MWB_RESULT_FT_PDF_COLUMNS = 0x00000021
 
static final int MWB_RESULT_FT_PDF_TRUNCATED = 0x00000022
 
static final int MWB_RESULT_FT_PDF_ECLEVEL = 0x00000023
 
static final int MWB_RESULT_FT_PDF_CODEWORDS = 0x00000024
 

Detailed Description

Represents a static BarcodeScanner class with native decoder.

Cognex Mobile Barcode SDK's easy API is preferred instead of this class and its associated legacy API. Unless explicitly directed to use this class, all new applications should now only be using ReaderDevice. Applications that use this API, may still use it, there is no need for migraton as it will be not removed without further notice.

Member Function Documentation

◆ MWBcleanupLib()

static native int com.manateeworks.BarcodeScanner.MWBcleanupLib ( )
static

Free memory resources allocated by library.

Should be invoked when library is not needed anymore, which is typically at application closing time. This cleanup is not necessary on most platforms, as memory resources are deallocated automatically by operating system.

Returns
MWB_RT_OK Success

◆ MWBcropPreviewFrame()

static native int [] com.manateeworks.BarcodeScanner.MWBcropPreviewFrame ( byte[]  previewBuffer,
int  width,
int  height,
int  newSize 
)
static

For use with StingRay.

Parameters
previewBufferpreview frame
widthframe width
heightframe height
newSizenew size for both width and height
Returns
frame cropped frame bytes (int array)

◆ MWBdisableCode()

static native int com.manateeworks.BarcodeScanner.MWBdisableCode ( int  codeMask)
static

Disable decoder type Remove barcode type from set of enabled types.

Parameters
codeMaskBit flags (MWB_CODE_MASK_...) of decoder type to be deactivated.
Returns
MWB_RT_OK Requested decoder type supported and deactivated. MWB_RT_NOT_SUPPORTED Requested decoder type is not supported in this library release

◆ MWBdisableFlag()

static native int com.manateeworks.BarcodeScanner.MWBdisableFlag ( int  codeMask,
int  flag 
)
static

Disable option for single barcode type (or global one).

MWB_disableFlag disable option (if any) for decoder type specified in a codeMask. Available options depend on selected decoder type.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
flagSelected decoder type option (MWB_FLAG_...) RSS decoder - no configuration options Code39 decoder - MWB_CFG_CODE39_REQ_CHKSUM - Checksum check mandatory
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Flag value out of range MWB_RT_NOT_SUPPORTED Flag value not supported for selected decoder

◆ MWBdisableSubcode()

static native int com.manateeworks.BarcodeScanner.MWBdisableSubcode ( int  codeMask,
int  subMask 
)
static

Disable subcode for given code group flag.

Parameters
codeMaskSingle decoder type/group (MWB_CODE_MASK_...)
subMaskFlag of requested decoder subtype (MWB_SUBC_MASK_)
Returns
MWB_RT_OK Deactivation successful MWB_RT_BAD_PARAM No decoder group selected MWB_RT_NOT_SUPPORTED Decoder group or subtype not supported

◆ MWBenableCode()

static native int com.manateeworks.BarcodeScanner.MWBenableCode ( int  codeMask)
static

Enable decoder type.

Upon library load, all decoder types are inactive by default. User must call this function at least once to choose active decoder.

Parameters
codeMaskBit flags (MWB_CODE_MASK_...) of decoder type to be activated.
Returns
MWB_RT_OK Requested decoder type supported and activated. MWB_RT_NOT_SUPPORTED Requested decoder type is not supported in this library release

◆ MWBenableFlag()

static native int com.manateeworks.BarcodeScanner.MWBenableFlag ( int  codeMask,
int  flag 
)
static

Enable option for single barcode type (or global one).

MWB_enableFlag configures option (if any) for decoder type specified in a codeMask. Available options depend on selected decoder type.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
flagSelected decoder type option (MWB_FLAG_...) RSS decoder - no configuration options Code39 decoder - MWB_CFG_CODE39_REQ_CHKSUM - Checksum check mandatory
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Flag value out of range MWB_RT_NOT_SUPPORTED Flag value not supported for selected decoder

◆ MWBenableSubcode()

static native int com.manateeworks.BarcodeScanner.MWBenableSubcode ( int  codeMask,
int  subMask 
)
static

Enable subcode for given code group flag.

Subcodes under some decoder type are all activated by default.

Parameters
codeMaskSingle decoder type/group (MWB_CODE_MASK_...)
subMaskFlag of requested decoder subtype (MWB_SUBC_MASK_)
Returns
MWB_RT_OK Activation successful MWB_RT_BAD_PARAM No decoder group selected MWB_RT_NOT_SUPPORTED Decoder group or subtype not supported

◆ MWBgetActiveCodes()

static native int com.manateeworks.BarcodeScanner.MWBgetActiveCodes ( )
static

Get active decoder types.

Returns
32-bit bit mask of OR-ed active decoder types

◆ MWBgetActiveSubcodes()

static native int com.manateeworks.BarcodeScanner.MWBgetActiveSubcodes ( int  codeMask)
static

Get active subcodes for given code group flag.

Parameters
codeMaskSingle decoder type/group (MWB_CODE_MASK_...)
Returns
greater than or equal to 0 Active subtypes for given code mask MWB_RT_BAD_PARAM No decoder group selected MWB_RT_NOT_SUPPORTED Decoder group or subtype not supported

◆ MWBgetBarcodeLocation()

static native float [] com.manateeworks.BarcodeScanner.MWBgetBarcodeLocation ( )
static

Barcode location points.

Returns quad points of detected barcode. Currently Works for PDF 417, QR, Datamatrix, Aztec and Dotcode

Returns
float array Barcode location points returned with coordinates in order - X1, Y1, X2, Y2, X3, Y3, X4, Y4

◆ MWBgetDeviceID()

static native String com.manateeworks.BarcodeScanner.MWBgetDeviceID ( )
static

Get device ID.

It should be called after registering call, and works only on iOS and Android.

Returns
non NULL ID of device NULL ID can't be retrieved

◆ MWBgetDirection()

static native int com.manateeworks.BarcodeScanner.MWBgetDirection ( )
static

Get active scanning direction.

Returns
ORed bit flags of active scanning directions given with MWB_SCANDIRECTION_... bit-masks

◆ MWBgetFlags()

static native int com.manateeworks.BarcodeScanner.MWBgetFlags ( int  codeMask)
static

Get active flags for single barcode type.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...) or 0 for global flags
Returns
32-bit mask of OR-ed active flags

◆ MWBgetLastType()

static native int com.manateeworks.BarcodeScanner.MWBgetLastType ( )
static

Retrieves actual detected code type after successful MWB_scanGrayscaleImage call.

If last call was not successful, it will return FOUND_NONE.

Returns
res_types Last decoded type MWB_RT_FAIL Library error

◆ MWBgetLibVersion()

static native int com.manateeworks.BarcodeScanner.MWBgetLibVersion ( )
static

Returns version code of Barcode Scanner Library.

Returns
32-bit version code in x.y.z format. Byte 3 (most significant byte): reserved (0) Byte 2: value x Byte 1: value y Byte 0 (least significant byte): value z

◆ MWBgetLicenseString()

static native String com.manateeworks.BarcodeScanner.MWBgetLicenseString ( )
static

Get license string for retrieving remaining devices It should be called after registering call, and works only on iOS and Android.

Returns
non NULL encrypted licenseString NULL ID can't be retrieved

◆ MWBgetParam()

static native int com.manateeworks.BarcodeScanner.MWBgetParam ( int  codeMask,
int  paramId 
)
static

Get specified decoder param.

MWB_setParam gets specified decoder param id/value pair for decoder type specified in a codeMask.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
paramIdID of param
Returns
greater than or equal to 0 Param value MWB_RT_BAD_PARAM Invalid parameter specified MWB_RT_NOT_SUPPORTED Function not supported for specified codeMask

◆ MWBgetResultType()

static native int com.manateeworks.BarcodeScanner.MWBgetResultType ( )
static

Get currently active result type.

Returns
resultType Type of result returned: MWB_RESULT_TYPE_RAW - return raw result bytes MWB_RESULT_TYPE_MW - return bytes of MWResult structure - should be converted to MWResult object.

◆ MWBgetScanningRect()

static RectF com.manateeworks.BarcodeScanner.MWBgetScanningRect ( int  codeMask)
inlinestatic

Get rectangular area for barcode scanning with selected single or multiple decoder type(s).

If codeMask is 0, union rectangle of all ACTIVE barcode types will be returned Output values are in percentages of screen width and height (range 0 - 100)

Parameters
codeMaskSingle decoder type selector (MWB_CODE_MASK_...) or 0
Returns
RectF Rectangle containing x, y, width, height (percentages)

◆ MWBgetScanningRectArray()

static native float [] com.manateeworks.BarcodeScanner.MWBgetScanningRectArray ( int  codeMask)
static

Get rectangular area for barcode scanning with selected single or multiple decoder type(s).

If codeMask is 0, union rectangle of all ACTIVE barcode types will be returned Output values are in percentages of screeen width and height (range 0 - 100)

Parameters
codeMaskSingle decoder type selector (MWB_CODE_MASK_...) or 0
Returns
float array float array containing x, y, width, height (percentages)

◆ MWBgetSupportedCodes()

static native int com.manateeworks.BarcodeScanner.MWBgetSupportedCodes ( )
static

Returns supported decoders in this library release.

Returns
32-bit bit mask where each non-zero bit represents supported decoder according to MWB_CODE_MASK_... values defined in BarcodeScanner.java file.

◆ MWBgetTargetRect()

static RectF com.manateeworks.BarcodeScanner.MWBgetTargetRect ( )
inlinestatic

Get rectangular area for targeted scanning Output values are in percentages of screeen width and height (range 0 - 100)

Returns
RectF Rectangle containing x, y, width, height (percentages)

◆ MWBgetTargetRectArray()

static native float [] com.manateeworks.BarcodeScanner.MWBgetTargetRectArray ( )
static

Get rectangular area for targeted scanning Output values are in percentages of screeen width and height (range 0 - 100)

Returns
float array float array containing x, y, width, height (percentages)

◆ MWBisLastGS1()

static native int com.manateeworks.BarcodeScanner.MWBisLastGS1 ( )
static

Retrieves is result of GS1 type.

Returns
1 true 0 false MWB_RT_FAIL Library error

◆ MWBregisterSDK() [1/2]

static native int com.manateeworks.BarcodeScanner.MWBregisterSDK ( String  key,
Activity  activity 
)
static

Registers licensing information for all SDK functionality.

It should be called once on app startup.

Parameters
keyLicense key string
activityActivity/Context
Returns
MWB_RT_OK Registration successful less than 0 Error code - see MWB_RTREG values

◆ MWBregisterSDK() [2/2]

static native int com.manateeworks.BarcodeScanner.MWBregisterSDK ( String  key,
Context  context 
)
static

Registers licensing information for all SDK functionality.

It should be called once on app startup.

Parameters
keyLicense key string
contextActivity/Context
Returns
MWB_RT_OK Registration successful less than 0 Error code - see MWB_RTREG values

◆ MWBregisterSDKCustom()

static native int com.manateeworks.BarcodeScanner.MWBregisterSDKCustom ( String  key,
String  customData,
Context  context 
)
static

Same as RegisterSDK with addition of custom string to be sent along with tracking info.

Parameters
keyLicense key string
customDataCustom string
contextActivity/Context
Returns
MWB_RT_OK Registration successful less than 0 Error code - see MWB_RTREG values

◆ MWBscanGrayscaleImage()

static native byte [] com.manateeworks.BarcodeScanner.MWBscanGrayscaleImage ( byte[]  gray,
int  width,
int  height 
)
static

Main scan function.

Invokes all activated decoders by priority. For successful scan, allocates byte array and passes it to user.

Parameters
grayByte array representing grayscale value of image pixels. Array should be stored in row after row fashion, starting with top row.
widthX axis size (width) of image.
heightY axis size (length) of image.
Returns
byte array of length greater than 0 On successful decode, library allocates new byte array where it stores the decoded result. null Null pointer for byte[] gray or out of range parameters, or unsupported decoder found in execution list.

◆ MWBsetActiveCodes()

static native int com.manateeworks.BarcodeScanner.MWBsetActiveCodes ( int  codeMask)
static

Sets active or inactive status of decoder types and updates decoder execution priority list.

Upon library load, all decoder types are inactive by default. User must call this function at least once to choose active set of active decoders.

Parameters
codeMaskORed bit flags (MWB_CODE_MASK_...) of decoder types to be activated. Bit value '1' activates corresponding decoder, while bit value deactivates it.
Returns
MWB_RT_OK All requested decoder types supported and activated. MWB_RT_NOT_SUPPORTED One or more requested decoder types is not supported in this library release. On this error, activation status of all supported types will not be changed.

◆ MWBsetActiveSubcodes()

static native int com.manateeworks.BarcodeScanner.MWBsetActiveSubcodes ( int  codeMask,
int  subMask 
)
static

Set active subcodes for given code group flag.

Subcodes under some decoder type are all activated by default.

Parameters
codeMaskSingle decoder type/group (MWB_CODE_MASK_...)
subMaskORed bit flags of requested decoder subtypes (MWB_SUBC_MASK_)
Returns
MWB_RT_OK Activation successful MWB_RT_BAD_PARAM No decoder group selected MWB_RT_NOT_SUPPORTED Decoder group or subtype not supported

◆ MWBsetDirection()

static native int com.manateeworks.BarcodeScanner.MWBsetDirection ( int  direction)
static

Configure scanning direction for 1D barcodes.

This function enables some control over scanning lines choice for 1D barcodes. By ORing available bit-masks user can add one or more direction options to scanning lines set. Density of lines and angle step for omni scan can be controlled with MWB_setLevel API function. Available options are:

  • MWB_SCANDIRECTION_HORIZONTAL - horizontal lines
  • MWB_SCANDIRECTION_VERTICAL - vertical lines
  • MWB_SCANDIRECTION_OMNI - omnidirectional lines
  • MWB_SCANDIRECTION_AUTODETECT - enables BarcodeScanner's autodetection of barcode direction
Parameters
directionORed bit mask of direction modes given with MWB_SCANDIRECTION_... bit-masks
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Direction out of range

◆ MWBsetDuplicate()

static native void com.manateeworks.BarcodeScanner.MWBsetDuplicate ( byte[]  barcode,
int  length 
)
static

Set the decoded barcode result to be checked as duplicate.

Parameters
barcodedecoded barcode result
lengthlength of the barcode byte array

◆ MWBsetDuplicatesTimeout()

static native int com.manateeworks.BarcodeScanner.MWBsetDuplicatesTimeout ( int  timeout)
static

Set time in seconds in which decoder will ignore same barcode detected.

Parameters
timeoutseconds to ignore same barcode
Returns
MWB_RT_OK Success

◆ MWBsetFlags()

static native int com.manateeworks.BarcodeScanner.MWBsetFlags ( int  codeMask,
int  flags 
)
static

Configure options for single barcode type.

MWB_setFlags configures options (if any) for decoder type specified in a codeMask. Options are given in a flags as bitwise OR of option bits. Available options depend on selected decoder type.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
flagsORed bit mask of selected decoder type options (MWB_FLAG_...) RSS decoder - no configuration options Code39 decoder - MWB_CFG_CODE39_REQ_CHKSUM - Checksum check mandatory
Returns
MWB_RT_OK Success MWB_RT_FAIL No code found in image MWB_RT_BAD_PARAM Flag values out of range MWB_RT_NOT_SUPPORTED Flag values not supported for selected decoder

◆ MWBsetLevel()

static native int com.manateeworks.BarcodeScanner.MWBsetLevel ( int  level)
static

Configure global library effort level Barcode detector relies on image processing and geometry interpolation for extracting optimal data for decoding.

Higher effort level involves more processing and intermediate parameter values, thus increasing probability of successful detection with low quality images, but also consuming more CPU time. Although level is global on library level, each decoder type has its own parameter set for each level.

Parameters
levelEffort level - available values are 1, 2, 3, 4 and 5.
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Level out of range for selected decoder

◆ MWBsetMinLength()

static native int com.manateeworks.BarcodeScanner.MWBsetMinLength ( int  codeMask,
int  minLength 
)
static

Set minimum result length for single barcode type.

MWB_setMinLength set minimum acceptable result length for decoder type specified in a codeMask.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
minLengthMinimum length of result Function is applicable to 1D barcode types with low or non existent error protection like Code39, Code25, Code 11, Codabar to prevent false results from short bars fragments
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Invalid parameter specified MWB_RT_NOT_SUPPORTED Function not supported for specified codeMask

◆ MWBsetParam()

static native int com.manateeworks.BarcodeScanner.MWBsetParam ( int  codeMask,
int  paramId,
int  paramValue 
)
static

Set custom decoder param.

MWB_setParam set custom decoder param id/value pair for decoder type specified in a codeMask.

Parameters
codeMaskSingle decoder type (MWB_CODE_MASK_...)
paramIdID of param
paramValueInteger value of param
Returns
MWB_RT_OK Success MWB_RT_BAD_PARAM Invalid parameter specified MWB_RT_NOT_SUPPORTED Function not supported for specified codeMask

◆ MWBsetResultType()

static native int com.manateeworks.BarcodeScanner.MWBsetResultType ( int  resultType)
static

Set result type from MWB_scanGrayscaleImage Users now can choose between getting raw result bytes as a result of image scan, or byte representation of complex result structure containing all information about the scanned barcode.

Parameters
resultTypeType of result returned: MWB_RESULT_TYPE_RAW - return raw result bytes MWB_RESULT_TYPE_MW - return bytes of MWResult structure - should be converted to MWResult object.
Returns
MWB_RT_OK Result type set successfully MWB_RT_FAIL Invalid result type specified

◆ MWBsetScanningRect() [1/2]

static native int com.manateeworks.BarcodeScanner.MWBsetScanningRect ( int  codeMask,
float  left,
float  top,
float  width,
float  height 
)
static

Sets rectangular area for barcode scanning with selected single decoder type.

After MWB_setScanningRect() call, all subseqent scans will be restricted to this region. If rectangle is not set, whole image is scanned. Also, if width or height is zero, whole image is scanned.

Parameters are interpreted as percentage of image dimensions, i.e. ranges are 0 - 100 for all parameters.

Parameters
codeMaskSingle decoder type selector (MWB_CODE_MASK_...)
leftX coordinate of left edge (percentage)
topY coordinate of top edge (percentage)
widthRectangle witdh (x axis) (percentage)
heightRectangle height (y axis) (percentage)
Returns
MWB_RT_OK Rectangle set successfully MWB_RT_BAD_PARAM Rectange percentages invalid (out of range)

◆ MWBsetScanningRect() [2/2]

static int com.manateeworks.BarcodeScanner.MWBsetScanningRect ( int  codeMask,
Rect  rect 
)
inlinestatic

Sets rectangular area for barcode scanning with selected single decoder type.

After MWB_setScanningRect() call, all subsequent scans will be restricted to this region. If rectangle is not set, whole image is scanned. Also, if width or height is zero, whole image is scanned.

Parameters are interpreted as percentage of image dimensions, i.e. ranges are 0 - 100 for all parameters.

Parameters
codeMaskSingle decoder type selector (MWB_CODE_MASK_...)
rectRectangle containing x, y, width, height (percentages)
Returns
MWB_RT_OK Rectangle set successfully MWB_RT_BAD_PARAM Rectangle percentages invalid (out of range)

◆ MWBsetTargetRect()

static native int com.manateeworks.BarcodeScanner.MWBsetTargetRect ( float  left,
float  top,
float  width,
float  height 
)
static

Sets rectangular area for targeted barcode scanning.

If rectangle size is greater than zero, decoder will discard all barcodes which location doesn't interleave with this rectangle If width or height is zero, targeted scanning is disabled

Parameters are interpreted as percentage of image dimensions, i.e. ranges are 0 - 100 for all parameters.

Parameters
leftX coordinate of left edge (percentage)
topY coordinate of top edge (percentage)
widthRectangle witdh (x axis) (percentage)
heightRectangle height (y axis) (percentage)
Returns
MWB_RT_OK Rectangle set successfully MWB_RT_BAD_PARAM Rectange percentages invalid (out of range)

◆ MWBvalidateVIN()

static native int com.manateeworks.BarcodeScanner.MWBvalidateVIN ( byte[]  vin)
static

Checks if the input is a valid Vehicle Identification Number.

Parameters
vinbyte array string
Returns
int result

Member Data Documentation

◆ MWB_CFG_CODE39_CODE32_ENABLED

final int com.manateeworks.BarcodeScanner.MWB_CFG_CODE39_CODE32_ENABLED = 0x10
static

Code39 decoder flags value: Try decoding result to CODE32.

if failed, Code39 will return

◆ MWB_RESULT_TYPE_RAW

final int com.manateeworks.BarcodeScanner.MWB_RESULT_TYPE_RAW = 0x00000001
static

Result structure constants.

Identifiers for result types


The documentation for this class was generated from the following file: