Skip to main content

Barcode

Represents a barcode detected on a receipt. Returned by ScanResults.barcodes(). Barcodes found by the camera's barcode detector are included when ScanOptions.detectBarcodes() is enabled; a barcode value read by the receipt OCR is also added, with type Text.

Package: com.microblink.core

Declaration

open class Barcode : Parcelable

Quick Reference​

Properties​

PropertyDescription
text()The decoded barcode value
type()The kind of content the barcode encodes

Methods​

MethodDescription
newBuilder()Creates a Barcode.Builder

Properties​

text()​

fun text(): String?

The decoded barcode value.


type()​

fun type(): BarcodeType?

The kind of content the barcode encodes (not its symbology, such as QR or EAN-13). BarcodeType (com.microblink.core) values:

ValueContent
UnknownUnknown content type
ContactInfoContact information
EmailEmail address
IsbnISBN
PhonePhone number
ProductProduct code
SmsSMS message
TextPlain text
UrlURL
WifiWi-Fi network settings
GeoGeographic location
CalendarEventCalendar event
DriverLicenseDriver's license data

Methods​

newBuilder()​

// Java static method
fun newBuilder(): Barcode.Builder

Returns a Barcode.Builder with .text(String?), .type(BarcodeType) and build(). Useful for test fixtures.