Set camera frames callback if you want to receive the frames/images only without decoding them and do your own work with the frames.
Don't forget to close the image at the end
fun setPreviewFramesCallback(previewFramesCallback: BarkoderPreviewFramesCallback)
Get maximum zoom factor that can be set for the camera preview
Zoom factor is received in MaxZoomAvailableCallback
fun getMaxZoomFactor(callback: MaxZoomAvailableCallback)
Set zoom factor for the camera preview. If preview session is already active this zoom factor will be set only for this session,
otherwise initial zoom will be set. Every next preview session will be started with this zoom factor.
fun setZoomFactor(zoomFactor: Int)
Check if current mobile device has flash available
Result is received in FlashAvailableCallback.
fun isFlashAvailable(callback: FlashAvailableCallback)
Turn flash ON/OFF
If preview session is already active this state be set only for active session,
otherwise the initial flash state is set. Every next preview session will be started with this state.
fun setFlashEnabled(enabled: Boolean)
Stop the camera preview session and decoding if active
fun stopCamera()
Start the camera preview (if is not already running) and the scanning process
fun startScanning(resultCallback: BarkoderResultCallback)
Stop the scanning process and the camera preview
fun stopScanning()
Pause only the scanning process. Camera preview is still running
fun pauseScanning()
Get the decoder config object. With this object you can enable/disable decoders (barcode types) or configure each one of them
@return Barkoder.Config object
fun getDecoderConfig(): Barkoder.Config
Get the location line color as integer
fun getLocationLineColor(): Int
Set the location line color as integer.
This line is used for marking the scanned barcode in the image result
fun setLocationLineColor(locationLineColor: Int)
Get the location line width as float.
fun getLocationLineWidth(): Float
Set the location line width as float.
This line is used for marking the scanned barcode in the image result
fun setLocationLineWidth(locationLineWidth: Float)
Get the region of interest line color as integer
fun getRoiLineColor(): Int
Set the region of interest line color as integer
fun setRoiLineColor(roiLineColor: Int)
Get the region of interest line width as float
fun getRoiLineWidth(): Float
Set the region of interest line width as float
fun setRoiLineWidth(roiLineWidth: Float)
Get the region of interest background color as integer
fun getRoiOverlayBackgroundColor(): Int
Set the region of interest line color as integer
fun setRoiOverlayBackgroundColor(roiOverlayBackgroundColor: Int)
Check if camera preview session will be closed when barcode is scanned
fun isCloseSessionOnResultEnabled(): Boolean
Set if camera preview session should be closed when barcode is scanned
fun setCloseSessionOnResultEnabled(closeSessionOnResultEnabled: Boolean)
Check if the image result is enabled.
Image result is received in BarkoderResultCallback as Bitmap
fun isImageResultEnabled(): Boolean
Set if image result is enabled, otherwise null will be received
fun setImageResultEnabled(imageResultEnabled: Boolean)
Check if barcode location in the image result is enabled.
If enabled, barcode in the result image will be marked
fun isLocationInImageResultEnabled()
Set if scanned barcode in the image result should be marked
fun setLocationInImageResultEnabled(locationInImageResultEnabled: Boolean)
Get active region of interest
@return Barkoder.BKRect object
fun getRegionOfInterest(): Barkoder.BKRect
Set region of interest in percentage
@param left. Default 3%
@param top. Default 20%
@param width. Default 94%
@param height. Default 60%
@throw IllegalArgumentException if input params are not valid
fun setRegionOfInterest(left: Float, top: Float, width: Float, height: Float)
Get maximum threads that are used for the decoding process
@return threads number as integer
fun GetThreadsLimit(): Int
Set maximum threads that will be used for the decoding process
@param threadsLimit [1, max threads available]
@throw IllegalArgumentException if input param is greater than maximum threads available on that device
fun SetThreadsLimit(threadsLimit: Int)
Check if barcode location in preview is enabled.
If enabled, scanned barcode will be marked on the preview screen for short time
@return true if enabled or false if is not enabled
fun isLocationInPreviewEnabled(): Boolean
Set if scanned barcode should be marked on the preview screen for short time
@param locationInPreviewEnabled [true, false]. Default is true
fun setLocationInPreviewEnabled(locationInPreviewEnabled: Boolean)
Check if the camera preview can be zoomed with pinch
@return true if enabled or false if is not enabled
fun isPinchToZoomEnabled(): Boolean
Enable or disable pinch to zoom on the camera preview
@param pinchToZoomEnabled [true, false]. Default is false
fun setPinchToZoomEnabled(pinchToZoomEnabled: Boolean)
Check if ROI is visible on the preview screen
@return true if visible or false otherwise
fun isRegionOfInterestVisible(): Boolean
Set if ROI should be visible on the preview screen
@param regionOfInterestVisible [true, false]. Default is true
fun setRegionOfInterestVisible(regionOfInterestVisible: Boolean)
Get the active resolution. It can be Normal(HD), or HIGH(Full HD)
@return BarkoderResolution object
fun getBarkoderResolution(): BarkoderResolution
Set the camera resolution that will be used while scanning
@param barkoderResolution [BarkoderResolution.NORMAL, BarkoderResolution.HIGH]. Default is BarkoderResolution.NORMAL
fun setBarkoderResolution(barkoderResolution: BarkoderResolution)
Check if device will beep on successful scan
@return true if enabled or false if is not enabled
fun isBeepOnSuccessEnabled(): Boolean
Set if device should beep on successful scan
@param beepOnSuccess [true, false]. Default is true
fun setBeepOnSuccessEnabled(beepOnSuccess: Boolean)
Check if device will vibrate on successful scan
@return true if enabled or false if is not enabled
fun isVibrateOnSuccessEnabled(): Boolean
Set if device should vibrate on successful scan
@param vibrateOnSuccess [true, false]. Default is true
fun setVibrateOnSuccessEnabled(vibrateOnSuccess: Boolean)
Set if device should return barcode thumbnail on result
@param enabled [true, false]. Default is true
fun setThumbnailOnResultEnabled(enabled Boolean)
Set threshold between duplicates scans
@param thresholdBetweenDuplicatesScans. Default value is 5
fun setTresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans Int)
Find out more: