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
Inherits IScanditSDK.
Inherited by LegacyPortraitScanditSDKBarcodePicker.
Public Member Functions | |
ScanditSDKBarcodePicker (Context context, string appKey) | |
ScanditSDKBarcodePicker (Context context, string appKey, int cameraFacingPreference) | |
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 Member Functions | |
static bool | CanRunPortraitPicker () |
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 | |
bool | SupportsCameraFacing (int facing) |
bool | ChangeCameraFacing (int facing) |
bool | SwitchCameraFacing () |
int | CameraFacingDirection [get] |
Detailed Description
Controls the scanning process and shows customizable portrait scan user interface.
Does not require full screen mode but also does not support portrait scan user interface on Android devices that only offer landscape camera feed.
This class starts and stops the barcode scanning and controls which barcode symbologies are decoded.
This is the current version of the scanner that uses Android API methods introduced in Android 2.2. The LegacyPortraitScanditSDKBarcodePicker is available for devices that run an older version or that have camera drivers that do not support a landscape camera feed.
Developers can call ScanditSDKBarcodePicker::CanRunPortraitPicker() to determine whether the particular Android device supports this picker or only the legacy version.
Apps implementing the Scandit SDK should either use the ScanditSDKAutoAdjustingBarcodePicker and show the scan user interface in full screen in a new Activity or selectively decide to show the LegacyPortraitScanditSDKBarcodePicker via calling ScanditSDKBarcodePicker::CanRunPortraitPicker(). when a landscape camera feed is not available.
Copyright 2010 Scandit. All rights reserved.
Constructor & Destructor Documentation
ScanditSDKBarcodePicker | ( | Context | context, |
string | appKey | ||
) |
Initiates the barcode picker.
To enable the analytics and location capabilities of the Scandit SDK, set the parameters accordingly. The app key is mandatory and is available via the Scandit SDK website.
- Parameters
-
context A context. appKey The Scandit SDK app key.
ScanditSDKBarcodePicker | ( | Context | context, |
string | appKey, | ||
int | cameraFacingPreference | ||
) |
Initiates the barcode picker.
To enable the analytics and location capabilities of the Scandit SDK, set the parameters accordingly. The app key is mandatory and is available via the Scandit SDK website.
- Parameters
-
context A context. appKey The Scandit SDK app key. cameraFacingPreference Which camera should be used assuming there is more than one available. Either CAMERA_FACING_BACK or CAMERA_FACING_FRONT.
Member Function Documentation
|
static |
Returns true if the ScanditSDKBarcodePicker can be used in portrait scanning mode for the particular Android device.
If the method returns false (on all Android 2.1 devices and a few, selected Android 2.2 devices with faulty camera drivers which do not support a portrait camera feed e.g. the Samsung Ace or Y), use this method to decide to use the ScanditSDKBarcodePicker in landscape mode or alternatively the LegacyPortraitScanditSDKBarcodePicker (requires full screen scan ui) on these devices. You can also use the ScanditSDKAutoAdjustingBarcodePicker which handles this automatically for you but requires a full screen scan ui.
- Returns
- Whether the device supports regular portrait camera feed.
|
inherited |
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
|
inherited |
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.
|
inherited |
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
|
inherited |
Returns true if scanning is in progress.
- Since
- 1.0.0
- Returns
- Whether scanning is in progress.
|
inherited |
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
|
inherited |
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
|
inherited |
Resume scanning after pauseScanning() was called.
- Since
- 4.0.0
|
inherited |
Pauses scanning while keeping the camera feed running.
- Since
- 4.0.0
|
inherited |
Resets the state of the barcode picker.
- Since
- 1.0.0
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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
|
inherited |
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.
|
inherited |
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
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Sets the zoom to the given percentage of the max zoom possible.
- Parameters
-
zoomPercentage The percentage of the max zoom (between 0 and 1).
|
inherited |
Sets the zoom level as defined by the Android Camera.
- Parameters
-
zoom Zoom level (0 to max zoom)
|
inherited |
Sets a listener object for capture events.
- Parameters
-
listener The listener.
|
inherited |
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
|
inherited |
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().
|
inherited |
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.
|
inherited |
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
|
inherited |
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.
|
inherited |
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
|
staticinherited |
Default camera orientation - facing away from user.
|
staticinherited |
Facetime camera orientation - facing the user.
|
staticinherited |
Default MSI Plessey Checksum.
Property Documentation
|
getinherited |
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.
|
getinherited |
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.