4.16. StarIoExtManagerListener
Provides status information about printers and peripherals
Method
Name
Contents
Tells the printer impossible.
Tells the printer has come online.
Tells the printer has come offline.
Tells the printer has come paper ready.
Tells the printer has come paper near end.
Tells the printer has come paper empty.
Tells the printer has come cover open.
Tells the printer has come cover close.
Tells the delegate the cash drawer has come open.
Tells the delegate the cash drawer has come close.
Tells the delegate the barcode reader impossible.
Tells the delegate the barcode reader connected.
Tells the delegate the barcode reader disconnected.
Tells the delegate the barcode data received.
Tells the listener the accessory connection succeeded from disconnection.
Tells the listener the accessory connection failed from disconnection.
Tells the accessory disconnected.
Tells the status updated.
4.16.1. onPrinterImpossible
Tells the printer impossible.
Declaration
void onPrinterImpossible();
Parameter
None
Return value
None
Examples
@Override public void onPrinterImpossible() { mComment.setText("Printer Impossible."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.2. onPrinterOnline
Tells the printer has come online.
Declaration
void onPrinterOnline();
Parameter
None
Return value
None
Examples
@Override void onPrinterOnline() { mComment.setText("Printer Online."); mComment.setTextColor(Color.BLUE); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.3. onPrinterOffline
Tells the printer has come offline.
Declaration
void onPrinterOffline();
Parameter
None
Return value
None
Examples
@Override void onPrinterOffline() { mComment.setText("Printer Offline."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.4. onPrinterPaperReady
Tells the printer has come paper ready.
Declaration
void onPrinterPaperReady();
Parameter
None
Return value
None
Examples
@Override void onPrinterPaperReady() { mComment.setText("Printer Paper Ready."); mComment.setTextColor(Color.BLUE); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.5. onPrinterPaperNearEmpty
Tells the printer has come paper near end.
Declaration
void onPrinterPaperNearEmpty();
Parameter
None
Return value
None
Examples
@Override void onPrinterPaperNearEmpty() { mComment.setText("Printer Paper Near Empty."); mComment.setTextColor(0xffffa500); // Orange }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.6. onPrinterPaperEmpty
Tells the printer has come paper empty.
Declaration
void onPrinterPaperEmpty();
Parameter
None
Return value
None
Examples
@Override void onPrinterPaperEmpty() { mComment.setText("Printer Paper Empty."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.7. onPrinterCoverOpen
Tells the printer has come cover open.
Declaration
void onPrinterCoverOpen();
Parameter
None
Return value
None
Examples
@Override void onPrinterCoverOpen() { mComment.setText("Printer Cover Open."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.8. onPrinterCoverClose
Tells the printer has come cover close.
Declaration
void onPrinterCoverClose();
Parameter
None
Return value
None
Examples
@Override void onPrinterCoverClose() { mComment.setText("Printer Cover Close."); mComment.setTextColor(Color.BLUE); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.9. onCashDrawerOpen
Tells the delegate the cash drawer has come open.
Declaration
void onCashDrawerOpen();
Parameter
None
Return value
None
Examples
void onCashDrawerOpen() { mComment.setText("Cash Drawer Open."); mComment.setTextColor(Color.MAGENTA); }
Refer to CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.10. onCashDrawerClose
Tells the delegate the cash drawer has come close.
Declaration
void onCashDrawerClose();
Parameter
None
Return value
None
Examples
@Override void onCashDrawerClose() { mComment.setText("Cash Drawer Close."); mComment.setTextColor(Color.BLUE); }
Refer to CashDrawerExtFragment.java, and CombinationExtFragment.java.
4.16.11. onBarcodeReaderImpossible
Tells the delegate the barcode reader impossible.
Declaration
void onBarcodeReaderImpossible();
Parameter
None
Return value
None
Examples
@Override void onBarcodeReaderImpossible() { mComment.setText("Barcode Reader Impossible."); mComment.setTextColor(Color.RED); }
Refer to BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.12. onBarcodeReaderConnect
Tells the delegate the barcode reader connected.
Declaration
void onBarcodeReaderConnect();
Parameter
None
Return value
None
Examples
@Override void onBarcodeReaderConnect() { mComment.setText("Barcode Reader Connect."); mComment.setTextColor(Color.BLUE); }
Refer to BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.13. onBarcodeReaderDisconnect
Tells the delegate the barcode reader disconnected.
Declaration
void onBarcodeReaderDisconnect();
Parameter
None
Return value
None
Examples
@Override void onBarcodeReaderDisconnect() { mComment.setText("Barcode Reader Disconnect."); mComment.setTextColor(Color.RED); }
Refer to BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.14. onBarcodeDataReceive
Tells the delegate the barcode data received.
Declaration
void onBarcodeDataReceive(byte[] data);
Parameter
Name
Contents
Type
data
Received barcode data
byte[]
Return value
None
Examples
@Override public void onBarcodeDataReceive( byte[] data) { String[] barcodeDataArray = new String(data).split("\n"); for(String barcodeData:barcodeDataArray) { ... } }
Refer to BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.15. onAccessoryConnectSuccess
Tells the listener the accessory connection succeeded from disconnection.
Declaration
void onAccessoryConnectSuccess();
Parameter
None
Return value
None
Examples
@Override void onAccessoryConnectSuccess() { mComment.setText("Accessory Connect Success."); mComment.setTextColor(Color.BLUE); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.16. onAccessoryConnectFailure
Tells the listener the accessory connection failed from disconnection.
Declaration
void onAccessoryConnectFailure();
Parameter
None
Return value
None
Examples
@Override void onAccessoryConnectFailure() { mComment.setText("Accessory Connect Failure."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.17. onAccessoryDisconnect
Tells the accessory disconnected.
Declaration
void onAccessoryDisconnect();
Parameter
None
Return value
None
Examples
@Override void onAccessoryDisconnect() { mComment.setText("Accessory Disconnect."); mComment.setTextColor(Color.RED); }
Refer to PrinterExtFragment.java, CashDrawerExtFragment.java, BarcodeReaderExtFragment.java and CombinationExtFragment.java.
4.16.18. onStatusUpdate
Tells the status updated.
Declaration
void onStatusUpdate(String status);
Parameter
Name
Contents
Type
status
Updated statusHexdecimal digit sequence of 3rd to 6th bytes in Automatic Status (ex.28000000
).Please refer to STAR Line Mode and StarPRNT command manual for details of Automatic Status.Status update timing* When the status changes* Even no status change, every 5 minString
Return value
None
Examples
@Override void onStatusUpdate(String status) { mComment.setText(status); mComment.setTextColor(Color.GREEN); }