How can I get the status (printed, failed, etc.) of a printed receipt?
How can I get the status (printed, failed, etc.) of a printed receipt?
We've just added a new component to our Android SDK that allows you to query the state of print jobs. The interface is the class PrintJobsConnector
. If you are printing the job yourself (creating the PrintJob
object manually), you can query the state of it given it's ID. To obtain the ID, you must use a new interface to performing the print: PrintJobsConnector.print()
which returns a print job ID. This ID can subsequently be used to call PrintJobsConnector.getState()
to get the state of the print job.
If you want to query the state of print jobs printed by another app (such as the core Clover applications) you can use PrintJobsConnector.getPrintJobIds()
, passing in a state to query. For example, to query for all of the IN_QUEUE
print jobs,
PrintJobsConnector connector = new PrintJobsConnector(context);
List<String> ids = connector.getPrintJobIds(PrintJobsContract.STATE_IN_QUEUE);
The state of a print job is an integer, and the possible values are defined by the PrintJobsContract.STATE_*
constants.
These changes will be available in the next release of the Clover Android SDK.
You guys should really include all of this printer information in your docs. It's really difficult to find these gems
1 Person is following this question.