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

Last update: November 1, 2024

API User Guide

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

iOS Android


The StarXpand SDK provides you with useful APIs to control the printer and POS peripheral devices.
Embed the StarIO10 library to your application and call it in combination with a necessary API according to the description page of each function.
API Reference List by Function (iOS)

For how to embed the StarIO10 library to an application, refer to the following URL.
https://github.com/star-micronics/StarXpand-SDK-iOS/blob/main/README.md#installation

Migration procedure from V1.0.0
Starting from StarXpand SDK V2.0.0, the OS versions that support the StarPrinter class methods are changed, which requires calling source codes to be changed.
For the specific description of changes, see here.

Search for Printer

Use StarDeviceDiscoveryManager to asynchronously search for the printer.
For the description using the sample code, see here.

Print

Create printing data in Step 1 and send it to the printer in Step 2.
Select the necessary function in each step and refer to the description using the sample code on the link destination.



Use Cash Drawer

Open and close the cash drawer connected to the printer.
For the description using the sample code, see here.

Acquire Printer Status

Acquire the printer status (example: paper present / not present).
To acquire the status, use the getStatus method of the StarPrinter class.
Refer to the sample contained in the SDK as well.

You can also use an event-based API. When the printer status changes, the PrinterDelegate class methods are called.
Refer to the sample contained in the SDK as well.

Use Barcode Reader

Use an event-based API to get the data read by the barcode reader.
When the barcode is read, the onDataReceived method of the InputDeviceDelegate class is called, and the barcode data can be obtained.
Refer to the sample contained in the SDK as well.

Use Customer Display

Generate the control data of the customer display, and then send it to the printer.
To generate the control data, use the DisplayBuilder class.
For how to send the control data, refer to Print Step 2.

Use Buzzer

Generate the control data of the buzzer, and then send it to the printer.
To generate the control data, use the BuzzerBuilder class.
For how to send the control data, refer to Print Step 2.

Use Melody Speaker

Generate the control data of the melody speaker, and then send it to the printer.
To generate the control data, use the MelodySpeakerBuilder class.
For how to send the control data, refer to Print Step 2.

Acquire Connection Status of Peripherals

Use an event-based API to acquire the connection status of peripherals.
When the connection status of an input device (barcode reader) changes, the InputDeviceDelegate class methods are called. When the connection status of the customer display changes, the DisplayDelegate class methods are called.
Refer to the sample contained in the SDK as well.

Obtain Logs

Obtain the logs of StarIO10 library API call information and transmission data.
To obtain the logs, use the StarIO10Logger class.

API Reference by Function

Communication API

StarPrinter
The class that controls the printer
StarConnectionSettings
The class that defines the settings for connecting to a device
StarPrinterInformation
The class that defines the printer information
StarPrinterInformationDetail
The class that defines the printer detailed information
StarPrinterInformationLan
The class that defines the printer communication information for LAN
StarPrinterInformationBluetooth
The class that defines the printer communication information for Bluetooth
StarPrinterInformationBluetoothLE
The class that defines the printer communication information for BluetoothLE
StarPrinterInformationUSB
The class that defines the printer communication information for USB
StarPrinterStatus
The class that defines the printer status
StarPrinterStatusDetail
The class that defines the detailed printer status
StarSpoolJobSettings
The class that defines the print job settings
StarSpoolJobStatus
The class that defines the print job status
InterfaceType
Interface type
StarPrinterEmulation
Printer emulation
StarPrinterModel
Printer model
SpoolJobState
State of print job
SpoolJobReceivedInterface
Interface on which the printer has accepted this print job
DrawerOpenedMethod
Method for opening cash drawer

Search API

StarDeviceDiscoveryManager
The class for discovering devices
StarDeviceDiscoveryManagerDelegate
The protocol that defines the event for discovering printers
StarDeviceDiscoveryManagerFactory
The class that creates a StarDeviceDiscoveryManager object

Event API

PrinterDelegate
The class that defines the printer status event
DrawerDelegate
The class that defines the status event for the cash drawer
InputDeviceDelegate
The class that defines the status event of an input device (such as Barcode Reader)
DisplayDelegate
The class that defines the status event for the customer display

Log API

StarIO10Logger
The class that controls the log

Error API

StarIO10Error
The error class that is thrown by the API for this library
StarIO10ErrorCode
StarIO10Error error code
StarIO10ErrorDetail
The class that defines the error detailed information

Printing Data/Control Data Generation APIs

StarXpandCommandBuilder
The class that creates StarXpandCommand
DocumentBuilder
The class that creates StarXpandCommand for a document
MagnificationParameter
Magnification setting parameters
TemplateExtensionParameter
Template print extension setting parameters on the template side

Printer

PrinterBuilder
The class that creates StarXpandCommand for a printer
PageModeBuilder
The class that creates StarXpandCommand for page mode
Printer
List of printer control parameters used in PrinterBuilder
Alignment
Alignment
AmbiguousCharacterWidthType
1-byte/2-byte setting for Unicode fuzzy characters
BarcodeBarRatioLevel
Ratio level of the barcode bar
BarcodeSymbology
Barcode symbol
BlackMarkPosition
Black mark position
CharacterEncodingType
Character encoding
CJKCharacterType
Character encoding
CutType
Paper cut type
FontType
Font Type
InternationalCharacterType
International characters
Pdf417Level
PDF417 ECC (security level)
QRCodeLevel
Error correction level for QR code
QRCodeModel
QR code model
TextAlignment
A value indicating alignment for the function specifying the number of characters
TextEllipsizeType
Omission method for the function specifying the number of characters
TextPrintType
Print method for the function specifying the number of characters
TextWidthType
1-byte/2-byte setting for the function specifying the number of characters
BarcodeParameter
Barcode setting parameters
BlackMarkParameter
Black mark setting parameters
HoldPrintParameter
Hold print setting parameters
ImageParameter
Image setting parameters
LabelParameter
Label setting parameters
LogoParameter
Logo setting parameters
Pdf417Parameter
PDF417 setting parameters
QRCodeParameter
QR code setting parameters
RuledLineParameter
Horizontal line setting parameters
LineStyle
Line style
PageModeAreaParameter
Printing area setting parameters in page mode
PageModeImageParameter
Image setting parameters in page mode
PageModePrintDirection
Print direction in page mode
PageModeRectangleParameter
Rectangle setting parameters in page mode
PageModeRuledLineParameter
Ruled line setting parameters in page mode
PrinterParameter
Setting parameters for the entire PrinterBuilder
PageModeParameter
Setting parameters for the entire PageModeBuilder
TextParameter
Text setting parameters
TextWidthParameter
Setting parameters for the function specifying the number of characters

Cash drawer

DrawerBuilder
The class that creates StarXpandCommand for a cash drawer
Drawer
List of drawer control parameters used in DrawerBuilder
Channel
Cash drawer channel
OpenParameter
Cash drawer open setting parameters

Buzzer

BuzzerBuilder
The class that creates StarXpandCommand for a buzzer
Buzzer
List of buzzer control parameters used in BuzzerBuilder
Channel
Buzzer channel
DriveParameter
Buzzer drive setting parameters

Melody speaker

MelodySpeakerBuilder
The class that creates StarXpandCommand for a melody speaker (mC-Sound)
MelodySpeaker
List of melody speaker control parameters used in MelodySpeakerBuilder
SoundStorageArea
Sound storage area
DriveRegisteredSoundParameter
Registered sound playback setting parameters
DriveOneTimeSoundParameter
Received data playback setting parameters

Display

DisplayBuilder
The class that creates StarXpandCommand for a customer display
Display
List of display control parameters used in DisplayBuilder
CharacterEncodingType
Character encoding
Contrast
Contrast value
CursorState
Cursor state
InternationalCharacterType
International characters
ImageParameter
Image setting parameters
PositionParameter
Position parameters

The StarXpand SDK provides you with useful APIs to control the printer and POS peripheral devices.
Embed the StarIO10 library to your application and call it in combination with a necessary API according to the description page of each function.
API Reference List by Function (Android)

For how to embed the StarIO10 library to an application, refer to the following URL.
https://github.com/star-micronics/StarXpand-SDK-Android/blob/main/README.md#installation


Search for Printer

Use StarDeviceDiscoveryManager to asynchronously search for the printer.
For the description using the sample code, see here.

Print

Create printing data in Step 1 and send it to the printer in Step 2.
Select the necessary function in each step and refer to the description using the sample code on the link destination.



Use Cash Drawer

Open and close the cash drawer connected to the printer.
For the description using the sample code, see here.

Acquire Printer Status

Acquire the printer status (example: paper present / not present).
To acquire the status, use the getStatus method of the StarPrinter class.
Refer to the sample contained in the SDK as well.

You can also use an event-based API. When the printer status changes, the PrinterDelegate class methods are called.
Refer to the sample contained in the SDK as well.

Use Barcode Reader

Use an event-based API to get the data read by the barcode reader.
When the barcode is read, the onDataReceived method of the InputDeviceDelegate class is called, and the barcode data can be obtained.
Refer to the sample contained in the SDK as well.

Use Customer Display

Generate the control data of the customer display, and then send it to the printer.
To generate the control data, use the DisplayBuilder class.
For how to send the control data, refer to Print Step 2.

Use Buzzer

Generate the control data of the buzzer, and then send it to the printer.
To generate the control data, use the BuzzerBuilder class.
For how to send the control data, refer to Print Step 2.

Use Melody Speaker

Generate the control data of the melody speaker, and then send it to the printer.
To generate the control data, use the MelodySpeakerBuilder class.
For how to send the control data, refer to Print Step 2.

Acquire Connection Status of Peripherals

Use an event-based API to acquire the connection status of peripherals.
When the connection status of an input device (barcode reader) changes, the InputDeviceDelegate class methods are called. When the connection status of the customer display changes, the DisplayDelegate class methods are called.
Refer to the sample contained in the SDK as well.

Obtain Logs

Obtain the logs of StarIO10 library API call information and transmission data.
To obtain the logs, use the StarIO10Logger class.

API Reference by Function

Communication API

StarPrinter
The class that controls the printer
StarConnectionSettings
The class that defines the settings for connecting to a device
StarPrinterInformation
The class that defines the printer information
StarPrinterInformationDetail
The class that defines the printer detailed information
StarPrinterInformationLan
The class that defines the printer communication information for LAN
StarPrinterInformationBluetooth
The class that defines the printer communication information for Bluetooth
StarPrinterInformationUsb
The class that defines the printer communication information for USB
StarPrinterStatus
The class that defines the printer status
StarPrinterStatusDetail
The class that defines the detailed printer status
StarSpoolJobSettings
The class that defines the print job settings
StarSpoolJobStatus
The class that defines the print job status
InterfaceType
Interface type
StarPrinterEmulation
Printer emulation
StarPrinterModel
Printer model
SpoolJobState
State of print job
SpoolJobReceivedInterface
Interface on which the printer has accepted this print job
DrawerOpenedMethod
Method for opening cash drawer

Search API

StarDeviceDiscoveryManager
The class for discovering devices
StarDeviceDiscoveryManager.Callback
The protocol that defines the event for discovering printers
StarDeviceDiscoveryManagerFactory
The class that creates a StarDeviceDiscoveryManager object

Event API

PrinterDelegate
The class that defines the printer status event
DrawerDelegate
The class that defines the status event for the cash drawer
InputDeviceDelegate
The class that defines the status event of an input device (such as Barcode Reader)
DisplayDelegate
The class that defines the status event for the customer display

Log API

StarIO10Logger
The class that controls the log

Error API

StarIO10Exception
The error class that is thrown by the API for this library
StarIO10ArgumentException
The error class that is thrown when an invalid argument is specified
StarIO10BadResponseException
The error class that is thrown when the response from a device is invalid
StarIO10CommunicationException
The error class that is thrown when a communication error occurs
StarIO10IllegalDeviceStateException
The error class that is thrown when the status of a host device is invalid
StarIO10InUseException
The error class that is thrown when the target device is in use
StarIO10InvalidOperationException
The error class that is thrown when an invalid operation is executed
StarIO10NotFoundException
The error class that is thrown when the target device is not found
StarIO10UnknownException
The error class that is thrown when an unknown error occurs
StarIO10UnprintableException
The error class that is thrown when a printer is unprintable
StarIO10UnsupportedModelException
The error class that is thrown when the target device is not supported
StarIO10AuthenticationException
The error class that is thrown when the authentication is failed
StarIO10ErrorCode
StarIO10Error error code
StarIO10ErrorDetail
The class that defines the error detailed information

Printing Data/Control Data Generation APIs

StarXpandCommandBuilder
The class that creates StarXpandCommand
DocumentBuilder
The class that creates StarXpandCommand for a document
PreSettingBuilder
The class that creates StarXpandCommand for a pre-setting
MagnificationParameter
Magnification setting parameters
TemplateExtensionParameter
Template print extension setting parameters on the template side

Printer

PrinterBuilder
The class that creates StarXpandCommand for a printer
PageModeBuilder
The class that creates StarXpandCommand for page mode
stario10.starxpandcommand.printer
List of printer control parameters used in PrinterBuilder
Alignment
Alignment
AmbiguousCharacterWidthType
1-byte/2-byte setting for Unicode fuzzy characters
BarcodeBarRatioLevel
Ratio level of the barcode bar
BarcodeSymbology
Barcode symbol
BlackMarkPosition
Black mark position
CharacterEncodingType
Character encoding
CjkCharacterType
Character encoding
CutType
Paper cut type
FontType
Font Type
InternationalCharacterType
International characters
Pdf417Level
PDF417 ECC (security level)
QRCodeLevel
Error correction level for QR code
QRCodeModel
QR code model
TextAlignment
A value indicating alignment for the function specifying the number of characters
TextEllipsizeType
Omission method for the function specifying the number of characters
TextPrintType
Print method for the function specifying the number of characters
TextWidthType
1-byte/2-byte setting for the function specifying the number of characters
BarcodeParameter
Barcode setting parameters
BlackMarkParameter
Black mark setting parameters
HoldPrintParameter
Hold print setting parameters
ImageParameter
Image setting parameters
LabelParameter
Label setting parameters
LogoParameter
Logo setting parameters
Pdf417Parameter
PDF417 setting parameters
QRCodeParameter
QR code setting parameters
RuledLineParameter
Horizontal line setting parameters
LineStyle
Line style
PageModeAreaParameter
Printing area setting parameters in page mode
PageModeImageParameter
Image setting parameters in page mode
PageModePrintDirection
Print direction in page mode
PageModeRectangleParameter
Rectangle setting parameters in page mode
PageModeRuledLineParameter
Ruled line setting parameters in page mode
PrinterParameter
Setting parameters for the entire PrinterBuilder
PageModeParameter
Setting parameters for the entire PageModeBuilder
TextParameter
Text setting parameters
TextWidthParameter
Setting parameters for the function specifying the number of characters

Cash drawer

DrawerBuilder
The class that creates StarXpandCommand for a cash drawer
stario10.starxpandcommand.drawer
List of drawer control parameters used in DrawerBuilder
Channel
Cash drawer channel
OpenParameter
Cash drawer open setting parameters

Buzzer

BuzzerBuilder
The class that creates StarXpandCommand for a buzzer
stario10.starxpandcommand.buzzer
List of buzzer control parameters used in BuzzerBuilder
Channel
Buzzer channel
DriveParameter
Buzzer drive setting parameters

Melody speaker

MelodySpeakerBuilder
The class that creates StarXpandCommand for a melody speaker (mC-Sound)
stario10.starxpandcommand.melodyspeaker
List of melody speaker control parameters used in MelodySpeakerBuilder
SoundStorageArea
Sound storage area
DriveRegisteredSoundParameter
Registered sound playback setting parameters
DriveOneTimeSoundParameter
Received data playback setting parameters

Display

DisplayBuilder
The class that creates StarXpandCommand for a customer display
sstario10.starxpandcommand.display
List of display control parameters used in DisplayBuilder
CharacterEncodingType
Character encoding
Contrast
Contrast value
CursorState
Cursor state
InternationalCharacterType
International characters
ImageParameter
Image setting parameters
PositionParameter
Position parameters

Presenter

PresenterSettingBuilder
The class that creates StarXpandCommand for a presenter setting
Presenter
List of presenter control parameters used in PresenterSettingBuilder
LedType
LED operating condition
LedAutomaticBlinkParameter
LED auto-blink setting parameters
ModeParameter
Presenter operation setting parameters

Bezel

BezelSettingBuilder
The class that creates StarXpandCommand for a bezel setting
Bezel
List of bezel control parameters used in BezelSettingBuilder
LedType
LED operating condition
LedAutomaticBlinkParameter
LED auto-blink setting parameters