API reference for barKoder's Android Barcode Reader SDK
BarkoderView #
The BarkoderView
class is part of barKoder's Android Barcode Reader SDK. It provides a variety of methods to control the barcode scanning process. These methods include setting a preview frames callback, manipulating the zoom factor, checking the availability and status of the device's flash, and starting, stopping, or pausing the scanning process. It also allows to set a maximum zoom factor and check whether the device's built-in flash can be used for illumination during barcode scanning. This class provides a granular control over the scanning process, allowing for a highly customizable barcode scanning experience.
setPreviewFramesCallback #
Set the camera frames callback if you only want to receive frames/images without decoding them, allowing you to work with the frames directly. Remember to close the image when finished.
@param previewFramesCallback
fun setPreviewFramesCallback(previewFramesCallback: BarkoderPreviewFramesCallback)
getMaxZoomFactor #
Retrieves the maximum available zoom factor for the device's camera
Zoom factor is received in MaxZoomAvailableCallback
@param callback MaxZoomAvailableCallback
fun getMaxZoomFactor(callback: MaxZoomAvailableCallback)
setZoomFactor #
Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning
@param zoomFactor[1,maxZoomFactor].
Default value is 1
fun setZoomFactor(zoomFactor: Int)
isFlashAvailable #
Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning
Result is received in FlashAvailableCallback.
@param callback
fun isFlashAvailable(callback: FlashAvailableCallback)
setFlashEnabled #
Enables or disables the device's flash (torch) for illumination during barcode scanning
@param enabled [true, false].
Default value is false.
fun setFlashEnabled(enabled: Boolean)
stopCamera #
Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
fun stopCamera()
startScanning #
Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed
@param resultCallback
@throw NullPointerException if BarkoderView config is not set
fun startScanning(resultCallback: BarkoderResultCallback)
stopScanning #
Halts the barcode scanning process, stopping the camera from capturing and processing barcode information
fun stopScanning()
pauseScanning #
Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session
fun pauseScanning()
BarkoderConfig #
The BarkoderConfig
class is a configuration class for the Barkoder
barcode scanning library. It includes methods to set and get various properties like line color and width, region of interest, thread limit, and other characteristics. It provides a highly customizable way for developers to configure their barcode scanning experience, allowing for a wide range of scanning scenarios to be supported.
getDecoderConfig #
Obtain the decoder config object. This object allows you to enable or disable decoders (barcode types) and configure each one individually.
fun getDecoderConfig(): Barkoder.Config
getLocationLineColor #
Retrieves the color code representing the line color used to indicate the location of detected barcodes
@return locationLineColor
fun getLocationLineColor(): Int
setLocationLineColor #
Sets the color of the lines used to indicate the location of detected barcodes on the camera feed
@param locationLineColor [valid color representation as integer].
Default value is Color.GREEN
fun setLocationLineColor(locationLineColor: Int)
getLocationLineWidth #
Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed
@return float locationLineWidth
fun getLocationLineWidth(): Float
setLocationLineWidth #
Sets the width of the lines indicating the location of detected barcodes on the camera feed
@param float locationLineWidth.
Default value is 4.0
fun setLocationLineWidth(locationLineWidth: Float)
getRoiLineColor #
Retrieves the color code representing the line color of the Region of Interest (ROI) on the camera preview
@return int roiLineColor
fun getRoiLineColor(): Int
setRoiLineColor #
Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed
@param roiLineColor [valid color representation as integer].
Default value is Color.RED
fun setRoiLineColor(roiLineColor: Int)
getRoiLineWidth #
Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview
@return float roiLineWidth
fun getRoiLineWidth(): Float
setRoiLineWidth #
Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.
@param roiLineWidth
Default value is 3.0
fun setRoiLineWidth(roiLineWidth: Float)
getRoiOverlayBackgroundColor #
Retrieves the int color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview
@return int roiOverlayBackgroundColor
fun getRoiOverlayBackgroundColor(): Int
setRoiOverlayBackgroundColor #
Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed
@param int roiOverlayBackgroundColor [valid color representation as integer].
Default value is 40% transparency
fun setRoiOverlayBackgroundColor(roiOverlayBackgroundColor: Int)
isCloseSessionOnResultEnabled #
Checks if the session is closed on result enabled
@return Boolean [true,false] ;
true if preview will be closed after result, false otherwise
fun isCloseSessionOnResultEnabled(): Boolean
setCloseSessionOnResultEnabled #
Enables or disables the automatic closing of the scanning session upon detecting a barcode result
@param Boolean closeSessionOnResultEnabled [false, true]
Default is true
fun setCloseSessionOnResultEnabled(closeSessionOnResultEnabled: Boolean)
isImageResultEnabled #
Check if the image result is enabled.
@return Boolean [true, false];
true if enabled or false if not enabled Image result is received in BarkoderResultCallback as Bitmap
fun isImageResultEnabled(): Boolean
setImageResultEnabled #
Enables or disables the capturing and processing of image data when a barcode is successfully detected.
@param Boolean imageResultEnabled [false, true].
Default is false
fun setImageResultEnabled(imageResultEnabled: Boolean)
isLocationInImageResultEnabled #
Check if barcode location in the image result is enabled.
If enabled, the barcode in the result image will be marked
@return Boolean [true,false];
true if enabled or false if it’s not enabled
fun isLocationInImageResultEnabled()
setLocationInImageResultEnabled #
Enables or disables the inclusion of barcode location information within the image data result
@param Boolean locationInImageResultEnabled [false, true].
Default is false
fun setLocationInImageResultEnabled(locationInImageResultEnabled: Boolean)
getRegionOfInterest #
Retrieves the region of interest (ROI)
@return Barkoder.BKRect object
fun getRegionOfInterest(): Barkoder.BKRect
setRegionOfInterest #
Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes
@param Float left. Default 3%
@param Float top. Default 20%
@param Float width. Default 94%
@param Float height. Default 60%
@throw IllegalArgumentException if input params are not valid
fun setRegionOfInterest(left: Float, top: Float, width: Float, height: Float)
getThreadsLimit #
Retrieves the threads limit
@return threads number as integer
fun GetThreadsLimit(): Int
SetThreadsLimit #
Sets the threads limit
@param int threadsLimit [1, max threads available]
@throw IllegalArgumentException if input param is greater than maximum threads available on the device
fun SetThreadsLimit(threadsLimit: Int)
isLocationInPreviewEnabled #
Get the value of locationInPreviewEnabled which enables or disabled the display of barcode location information on the camera preview
If enabled, the scanned barcode will be marked on the preview screen for a short time
@return Boolean [true,false];
true if enabled or false if it’s not enabled
fun isLocationInPreviewEnabled(): Boolean
setLocationInPreviewEnabled #
Enables or disables the display of barcode location information on the camera preview
@param Boolean locationInPreviewEnabled [true, false].
Default is true
fun setLocationInPreviewEnabled(locationInPreviewEnabled: Boolean)
isPinchToZoomEnabled #
Checks if pinch to zoom is enabled
@return Boolean [true,false; ]
true if enabled or false if it’s not enabled
fun isPinchToZoomEnabled(): Boolean
setPinchToZoomEnabled #
Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning
@param Boolean pinchToZoomEnabled [true, false].
Default is false
fun setPinchToZoomEnabled(pinchToZoomEnabled: Boolean)
isRegionOfInterestVisible #
Checks if the region of interest (ROI) is visible
@return Boolean [true,false];
true if visible or false otherwise
fun isRegionOfInterestVisible(): Boolean
setRegionOfInterestVisible #
Sets the visibility of the Region of Interest (ROI) on the camera preview
@param Boolean regionOfInterestVisible [true, false]
.
Default is true
fun setRegionOfInterestVisible(regionOfInterestVisible: Boolean)
getBarkoderResolution #
Retrieves the resolution for barcode scanning
@return BarkoderResolution object
NORMAL("HD", 1280, 720),
HIGH("Full HD", 1920, 1080);
fun getBarkoderResolution(): BarkoderResolution
setBarkoderResolution #
Sets the resolution for barcode scanning
@param BarkoderResolution barkoderResolution
Default is BarkoderResolution.NORMAL
NORMAL("HD", 1280, 720),
HIGH("Full HD", 1920, 1080);
fun setBarkoderResolution(barkoderResolution: BarkoderResolution)
isBeepOnSuccessEnabled #
Retrieves the value indicating whether a beep sound is played on successful barcode scanning
@return Boolean [true,false];
true if enabled or false if it’s not enabled
fun isBeepOnSuccessEnabled(): Boolean
setBeepOnSuccessEnabled #
Enables or disables the audible beep sound upon successfully decoding a barcode
@param Boolean beepOnSuccess [true, false].
Default is true
fun setBeepOnSuccessEnabled(beepOnSuccess: Boolean)
isVibrateOnSuccessEnabled #
Retrieves the value indicating whether vibration is enabled on successful barcode scanning
@return Boolean [true,false];
true if enabled or false if it’s not enabled
fun isVibrateOnSuccessEnabled(): Boolean
setVibrateOnSuccessEnabled #
Enables or disables the device vibration upon successfully decoding a barcode.
@param Boolean enabled [true, false].
Default is true
fun setVibrateOnSuccessEnabled(enabled: Boolean)
setThumbnailOnResultEnabled #
Sets whether to enable barcode thumbnail on result
@param Boolean enabled [true, false].
Default is true
fun setThumbnailOnResultEnabled(enabled Boolean)
setTresholdBetweenDuplicatesScans #
Sets the threshold between duplicate scans
@param int thresholdBetweenDuplicatesScans.
Default value is 5
fun setTresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans Int)
getThresholdBetweenDuplicatesScans #
Retrieves the threshold between duplicate scans
return int thresholdBetweenDuplicatesScans
IsMulticodeCachingEnabled #
Retrieves whether multi-code caching is enabled
public static boolean IsMulticodeCachingEnabled() {
return Barkoder.GetGlobalOption(Barkoder.Config.GlobalOption_MulticodeCachingEnabled) == 1;
}
SetMulticodeCachingEnabled #
Sets whether multi-code caching is enabled
public static void SetMulticodeCachingEnabled(boolean enabled) {
Barkoder.SetGlobalOption(Barkoder.Config.GlobalOption_MulticodeCachingEnabled, enabled ? 1 : 0);
}
GetMulticodeCachingDuration #
Retrieves the caching duration (in milliseconds) for multi-code results
public static int GetMulticodeCachingDuration() {
return Barkoder.GetGlobalOption(Barkoder.Config.GlobalOption_MulticodeCachingDuration);
}
SetMulticodeCachingDuration #
Sets the caching duration (in milliseconds) for multi-code results
public static void SetMulticodeCachingDuration(int durationInMS) {
Barkoder.SetGlobalOption(Barkoder.Config.GlobalOption_MulticodeCachingDuration, durationInMS);
}
For a comprehensive understanding of our products and services, we invite you to visit our official website at https://barkoder.com. Our site contains a wealth of information and resources designed to help you better understand how our Barcode Reader SDK can add value to your Android applications.
If you're considering implementing our SDK and would like to understand the potential costs, you can easily request a quote at any time. Our team is always ready to assist you, providing you with detailed and tailored pricing information based on your specific needs. We look forward to the opportunity to work with you!