Deprecation warning
Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.
We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.
You'll find the updated documentation at: Data Capture SDK Documentation for Xamarin.Android and Data Capture SDK Documentation for Xamarin.iOS
Inherited by ScanditSDKAutoAdjustingBarcodePicker, and ScanditSDKBarcodePicker.
Public Member Functions | |
Barcode Decoder Operations | |
Start and stop the barcode decoder | |
bool | IsScanning () |
void | StartScanning () |
void | StopScanning () |
void | ResumeScanning () |
void | PauseScanning () |
void | Reset () |
Barcode Decoder Configuration | |
Adjust the decoding process and area. | |
void | RestrictActiveScanningArea (bool restrict) |
void | SetScanningHotSpot (float x, float y) |
void | SetScanningHotSpotHeight (float height) |
void | SetMicroDataMatrixEnabled (bool enabled) |
void | SetInverseRecognitionEnabled (bool enabled) |
void | Force2dRecognition (bool force) |
Barcode Symbology Selection | |
Configure which symbologies are decoded. | |
void | Set1DScanningEnabled (bool enabled) |
void | Set2DScanningEnabled (bool enabled) |
void | SetEan13AndUpc12Enabled (bool enabled) |
void | SetEan8Enabled (bool enabled) |
void | SetUpceEnabled (bool enabled) |
void | SetCode39Enabled (bool enabled) |
void | SetCode93Enabled (bool enabled) |
void | SetCode128Enabled (bool enabled) |
void | SetItfEnabled (bool enabled) |
void | SetMsiPlesseyEnabled (bool enabled) |
void | SetMsiPlesseyChecksumType (SIMsiPlesseyChecksumType checksumType) |
void | SetGS1DataBarEnabled (bool enabled) |
void | SetGS1DataBarExpandedEnabled (bool enabled) |
void | SetGS1DataBarLimitedEnabled (bool enabled) |
void | SetCodabarEnabled (bool enabled) |
void | SetQrEnabled (bool enabled) |
void | SetCode11Enabled (bool enabled) |
void | SetCode25Enabled (bool enabled) |
void | SetMaxiCodeEnabled (bool enabled) |
void | SetDataMatrixEnabled (bool enabled) |
void | SetAztecEnabled (bool enabled) |
void | SetPdf417Enabled (bool enabled) |
Torch Control | |
Switch torch programmatically | |
void | SwitchTorchOn (bool on) |
Zoom Access | |
void | SetZoom (float zoomPercentage) |
void | SetZoom (int zoom) |
Camera Frame Access | |
void | setCaptureListener (ScanditSDKCaptureListener listener) |
byte[] | GetMostRecentCameraPreviewImage () |
byte[] | GetCameraPreviewImageOfFirstBarcodeRecognition () |
int | CameraPreviewImageWidth (get;) public int CameraPreviewImageHeight(get |
Camera Feed Display | |
void | IgnorePreviewAspectRatio () |
Development options | |
void | SetProperty (string name, Object value) |
Object | GetProperty (string name) |
Static Public Attributes | |
static final int | CAMERA_FACING_BACK |
static final int | CAMERA_FACING_FRONT |
static final int | CHECKSUM_MOD_10 |
Properties | |
IScanditSDKOverlay | OverlayView [get] |
Camera Selection | |
int | CameraFacingDirection [get] |
bool | SupportsCameraFacing (int facing) |
bool | ChangeCameraFacing (int facing) |
bool | SwitchCameraFacing () |
Detailed Description
Interface to control the barcode scanning process - implemented by ScanditSDKAutoAdjustingBarcodePicker, ScanditSDKBarcodePicker, and the LegacyPortraitScanditSDKBarcodePicker.
Copyright 2010 Scandit. All rights reserved.
Member Function Documentation
bool SupportsCameraFacing | ( | int | facing | ) |
Returns whether the specified camera facing direction is supported by the current device.
- Since
- 3.0.0
- Parameters
-
facing The camera facing direction in question.
- Returns
- Whether the camera facing direction is supported
bool ChangeCameraFacing | ( | int | facing | ) |
Changes to the specified camera facing direction if it is supported.
The legacy picker will never switch away from the default camera.
- Since
- 3.0.0
- Parameters
-
facing The new camera facing direction.
- Returns
- Whether the change was successful.
bool SwitchCameraFacing | ( | ) |
Changes to the opposite camera facing if it is supported.
The legacy picker will never switch away from the default camera.
- Since
- 3.0.0
- Returns
- Whether the change was successful
bool IsScanning | ( | ) |
Returns true if scanning is in progress.
- Since
- 1.0.0
- Returns
- Whether scanning is in progress.
void StartScanning | ( | ) |
Starts the scanning process.
This locks the device's camera and gives you the responsibility to unlock the camera again with StopScanning(). The way Android handles the camera lock you will need to unlock it at the latest when your Activity loses focus (in Activity.onPause()) to not cause problems for other apps.
- See also
- StopScanning()
- Since
- 1.0.0
void StopScanning | ( | ) |
Stops the scanning process.
This unlocks the device's camera if it was previously locked by ScanditSDK::startScanning().
- See also
- ScanditSDK::startScanning()
- Since
- 1.0.0
void ResumeScanning | ( | ) |
Resume scanning after pauseScanning() was called.
- Since
- 4.0.0
void PauseScanning | ( | ) |
Pauses scanning while keeping the camera feed running.
- Since
- 4.0.0
void Reset | ( | ) |
Resets the state of the barcode picker.
- Since
- 1.0.0
void RestrictActiveScanningArea | ( | bool | restrict | ) |
Reduces the area in which barcodes are detected and decoded.
When activated, the active scanning area is defined by setScanningHotSpotHeight(float) and setScanningHotSpot(float, float). If this method is not enabled, barcodes in the full camera image are detected and decoded.
By default this is not enabled.
- Since
- 4.0.0
- Parameters
-
restrict Whether the scanning area should be restricted.
void SetScanningHotSpot | ( | float | x, |
float | y | ||
) |
Sets the location in the image where barcodes are decoded with the highest priority.
This method shows a slightly different behavior depending on whether the full screen scanning is active or not. In Full screen scanning mode:
Sets the location in the image which is decoded with the highest priority when multiple barcodes are present in the image.
In restrictActiveScanningArea mode (activated with restrictActiveScanningArea(bool)):
Changes the location of the spot where the barcode decoder actively scans for barcodes.
X and Y can be between 0 and 1, where 0/0 corresponds to the top left corner and 1/1 to the bottom right corner.
The default hotspot is set to 0.5/0.5
- See also
- ScanditSDKBarcodePicker::restrictActiveScanningArea(bool)
- ScanditSDKBarcodePicker::setScanningHotSpotHeight(float)
- Since
- 1.0.0
- Parameters
-
x The hotspot's relative x coordinate. y The hotspot's relative y coordinate.
void SetScanningHotSpotHeight | ( | float | height | ) |
Changes the height of the area where barcodes are decoded in the camera image when restrictActiveScanningArea is activated.
The height of the active scanning area is relative to the height of the screen and has to be between 0.0 and 0.5.
This only applies if the active scanning area is restricted.
The default is 0.25
- See also
- ScanditSDKBarcodePicker::restrictActiveScanningArea(bool)
- ScanditSDKBarcodePicker::setScanningHotSpot(float, float)
- Since
- 1.0.0
- Parameters
-
height The relative height of the active scanning area.
void SetMicroDataMatrixEnabled | ( | bool | enabled | ) |
Enable the detection/decoding of tiny Data Matrix and/or QR codes.
When this mode is enabled, a dedicated localization algorithm is activated that searches for small Datamatrix codes in the central part of the camera image. This algorithm requires additional resources and slows down the recognition of other barcode symbologies. We recommend using the method only when your application requires the decoding of tiny Datamatrix codes.
By default this mode is disabled.
- Since
- 3.0.0
- Parameters
-
enabled Whether this mode should be enabled.
void SetInverseRecognitionEnabled | ( | bool | enabled | ) |
Enables the detection of white on black codes.
This option currently only works for Data Matrix codes.
By default this mode is disabled.
- Since
- 3.0.0
- Parameters
-
enabled Whether this mode should be enabled.
void Force2dRecognition | ( | bool | force | ) |
Forces the barcode scanner to always run the 2D decoders (QR, Datamatrix, etc.), even when the 2D detector did not detect the presence of a 2D code.
This slows down the overall scanning speed, but can be useful when your application only tries to read QR codes. It is by default enabled when the micro Datamatrix mode is enabled.
By default, this is disabled.
- Parameters
-
force bool indicating whether this mode should be enabled.
- Since
- 2.0.0
void Set1DScanningEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of all 1D barcode symbologies supported by the particular Scandit SDK edition you are using.
By default all 1D symbologies except for MSI Plessey and GS1 DataBar are enabled.
- Since
- 1.0.0
- Parameters
-
enabled Whether all 1D symbologies should be enabled.
void Set2DScanningEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of 2D barcode symbologies supported by the particular Scandit SDK edition you are using.
By default only QR is enabled.
- Since
- 1.0.0
- Parameters
-
enabled boolean indicating whether all 2D symbologies are enabled
void SetEan13AndUpc12Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for EAN13 and UPC12/UPCA codes.
By default scanning of EAN13 and UPC barcodes is enabled.
- Since
- 1.0.0
- Parameters
-
enabled boolean indicating whether this symbology should be enabled.
void SetEan8Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for EAN8 codes.
By default scanning of EAN8 barcodes is enabled.
- Since
- 1.0.0
- Parameters
-
enabled boolean indicating whether this symbology should be enabled.
void SetUpceEnabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for UPCE codes.
By default scanning of UPCE barcodes is enabled.
- Since
- 1.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetCode39Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Code39 codes.
By default scanning of Code39 barcodes is enabled. Note: Code39 scanning is only available with the Professional and Enterprise Packages.
- Since
- 1.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetCode93Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Code93 codes.
By default scanning of Code93 barcodes is disabled. Note: Code93 scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.1.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetCode128Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Code128 codes.
By default scanning of Code128 barcodes is enabled. Note: Code28 scanning is only available with the Professional and Enterprise Packages.
- Since
- 1.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetItfEnabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for ITF (Interleaved 2 out of 5) codes.
By default scanning of ITF barcodes is enabled. Note: ITF scanning is only available with the Professional and Enterprise Packages.
- Since
- 1.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetMsiPlesseyEnabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for MSI Plessey codes.
By default scanning of MSI Plessey barcodes is disabled. Note: MSI Plessey scanning is only available with the Professional and Enterprise Packages.
- Since
- 3.2.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetMsiPlesseyChecksumType | ( | SIMsiPlesseyChecksumType | checksumType | ) |
Sets the type of checksum that is expected of the MSI Plessey codes.
MSI Plessey is used with different checksums. Set the checksum your application uses with this method.
By default it is set to CHECKSUM_MOD_10.
- Since
- 3.2.0
- Parameters
-
checksumType The MSIPlesseyChecksumType your application uses.
void SetGS1DataBarEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of DataBar 14 codes.
By default scanning of GS1 Databar 14 barcodes is disabled. Note: GS1 Databar 14 scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.1.0
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetGS1DataBarExpandedEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of DataBar Expanded codes.
By default scanning of GS1 Databar Expanded barcodes is disabled. Note: GS1 Databar Expanded scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.1.0
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetGS1DataBarLimitedEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of DataBar Limited codes.
By default scanning of GS1 Databar Limited barcodes is disabled. Note: GS1 Databar Limited scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.11.0
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetCodabarEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of Codabar codes.
By default scanning of Codabar barcodes is disabled. Note: Codabar scanning is only available with the Professional and Enterprise Packages.
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetQrEnabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for QR codes.
By default scanning of QR barcodes is enabled.
- Since
- 2.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetCode11Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Code11 codes.
By default scanning of Code11 barcodes is disabled. Note: Code11 scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.9.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetCode25Enabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Code25 codes.
By default scanning of Code25 barcodes is enabled. Note: Code25 scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.13.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetMaxiCodeEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of MaxiCodes.
By default scanning of MaxiCodes is disabled.
Note: MaxiCode scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.9.0
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetDataMatrixEnabled | ( | bool | enabled | ) |
Enables or disables the barcode decoder for Datamatrix codes.
By default scanning of Datamatrix codes is enabled.
Note: Datamatrix scanning is only available with the Professional and Enterprise Packages.
- Since
- 2.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SetAztecEnabled | ( | bool | enabled | ) |
Enables or disables the recognition of Aztec codes.
By default scanning of Aztec codes is disabled.
Note: Aztec scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.3.0
- Parameters
-
enabled Whether it should be enabled. Default is false.
void SetPdf417Enabled | ( | bool | enabled | ) |
Enables or disables the recognition of PDF 417 codes.
By default scanning of PDF417 codes is disabled.
Note: PDF417 scanning is only available with the Professional and Enterprise Packages.
- Since
- 4.0.0
- Parameters
-
enabled Whether this symbology should be enabled.
void SwitchTorchOn | ( | bool | on | ) |
Switches the torch on or off.
If the torch button is enabled on the overlay, users can change this by clicking it.
- Since
- 2.0.0
- Parameters
-
on Whether the torch should be on.
void SetZoom | ( | float | zoomPercentage | ) |
Sets the zoom to the given percentage of the max zoom possible.
- Parameters
-
zoomPercentage The percentage of the max zoom (between 0 and 1).
void SetZoom | ( | int | zoom | ) |
Sets the zoom level as defined by the Android Camera.
- Parameters
-
zoom Zoom level (0 to max zoom)
void setCaptureListener | ( | ScanditSDKCaptureListener | listener | ) |
Sets a listener object for capture events.
- Parameters
-
listener The listener.
byte [] GetMostRecentCameraPreviewImage | ( | ) |
Returns the last image returned by the Camera.
(The image will be "landscape" oriented. It's dimensions can be accessed using CameraPreviewImageWidth() and CameraPreviewImageHeight().)
- Since
- 1.0.0
- Returns
- Byte array containing the image information in the NV21 format (YCrCb format, which uses the NV21 encoding format) or null, in case no preview image has been obtained so far
byte [] GetCameraPreviewImageOfFirstBarcodeRecognition | ( | ) |
Returns the image in which the bar code has been recognized for the first time.
The image will be "landscape" oriented. It's dimensions can be accessed using CameraPreviewImageWidth() and CameraPreviewImageHeight().
- Since
- 1.0.0
- Returns
- Byte array containing the image information in the NV21 format (YCrCb format, which uses the NV21 encoding format), or null, in case no barcode has been recognized since the recognition start or the last call of reset().
int CameraPreviewImageWidth | ( | get; | ) |
The width of the preview images from the active camera.
- Since
- 1.0.0
- Returns
- The width of the camera preview image in pixels. The height of the preview images from the active camera.
- Since
- 1.0.0
- Returns
- The height of the camera preview image in pixels.
void IgnorePreviewAspectRatio | ( | ) |
Makes the picker ignore the screen's aspect ratio.
Normally the picker adjusts to the aspect ratio of the preview image. If this is called, it will no longer do this. Warning: If the aspect ratio is not kept, the camera feed may be stretched and no longer be a proper representation of what is recorded.
- Since
- 2.0.0
void SetProperty | ( | string | name, |
Object | value | ||
) |
Sets a property.
This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.
- Since
- 1.0.0
- Parameters
-
name The property's name. value The property's value.
Object GetProperty | ( | string | name | ) |
Gets a property.
This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.
- Since
- 1.0.0
- Parameters
-
name The property's name.
- Returns
- The property's value.
Member Data Documentation
|
static |
Default camera orientation - facing away from user.
|
static |
Facetime camera orientation - facing the user.
|
static |
Default MSI Plessey Checksum.
Property Documentation
|
get |
Returns the overlay view.
Use this method to access the ScanditSDKOverlay and customize the scan UI. See ScanditSDKOverlay for all the available options.
- Returns
- The overlay view on top of the camera feed. This view is always a RelativeLayout.
|
get |
Returns which direction the currently shown camera is facing.
- Since
- 3.0.0
- Returns
- Which way the camera faces, either CAMERA_FACING_BACK or CAMERA_FACING_FRONT.