StarXpand SDK for iOS/Android Developer's Manual Ver. 1.14.0

Last update: Sep. 15, 2026

Use Barcode Reader

The procedure and the reference vary depending on the OS. Select the OS to display.

iOS Android


This section describes the structures of StarPRNT SDK and StarXpand SDK for barcode reader operations.

Understand the differences between these SDKs before migrating to StarXpand SDK.


StarPRNT SDK

The procedure for monitoring events, such as receiving data from and connecting to/disconnecting from the barcode reader, is the same as described in Monitor Printer Status.
Set an object conforming to the StarIoExtManagerDelegate protocol to the StarIoExtManager.delegate property.
Calling connect() in this state causes the corresponding delegate method to be executed when the above event occurs.
func didBarcodeDataReceive(_ manager: StarIoExtManager!, data: Data!) {
    print("Barcode Reader: Received data \(data)")
}

func didBarcodeReaderDisconnect(_ manager: StarIoExtManager!) {
    print("Barcode Reader: Disconnect")
}

The delegate methods for barcode readers are as follows: Sample code (GitHub)



StarXpand SDK

Set an object conforming to the InputDeviceDelegate protocol to the StarPrinter.inputDeviceDelegate property.
Calling open() in this state causes the corresponding delegate method to be executed when an event occurs on a peripheral connected to the printer.
func inputDeviceDidDisconnect(printer: StarPrinter) {
    print("Input Device: Disconnected")
}

func inputDevice(printer: StarPrinter, didReceive data: Data) {
    print("Input Device: DataReceived \(NSData(data: data))")
}

The delegate methods corresponding to barcode reader events are as follows: Sample code (GitHub)

Refer to Supported API List for information on whether each API is supported in StarPRNT SDK and StarXpand SDK.

This section describes the structures of StarPRNT SDK and StarXpand SDK for barcode reader operations.

Understand the differences between these SDKs before migrating to StarXpand SDK.


StarPRNT SDK

The procedure for monitoring events, such as receiving data from and connecting to/disconnecting from the barcode reader, is the same as described in Monitor Printer Status.
Specify an object implementing the IStarIoExtManagerListener interface in the StarIoExtManager constructor.
Calling connect() in this state causes the corresponding listener method to be executed when any event occurs on the barcode reader.
override fun onBarcodeDataReceive(data: ByteArray) {
    Log.d(TAG, "Barcode Reader: Received data ${data.contentToString()}")
}

override fun onBarcodeReaderDisconnect() {
    Log.d(TAG, "Barcode Reader: Disconnect")
}

The listener methods for barcode readers are as follows: Sample code (GitHub)



StarXpand SDK

Set an object implementing the InputDeviceDelegate interface to the StarPrinter.inputDeviceDelegate property.
Calling openAsync() in this state causes the corresponding callback method to be executed when an event occurs on a peripheral connected to the printer.
override fun inputDeviceDidDisconnect(printer: StarPrinter) {
    Log.d(TAG, "Input Device: Disconnected")
}

override fun inputDeviceDidReceive(printer: StarPrinter, data: ByteArray) {
    Log.d(TAG, "Input Device: DataReceived ${data.contentToString()}")
}

The callback methods corresponding to barcode reader events are as follows: Sample code (GitHub)

Refer to Supported API List for information on whether each API is supported in StarPRNT SDK and StarXpand SDK.