Stay organized with collections
Save and categorize content based on your preferences.
android.printservice
Provides classes for implementing print services. Print services are plug-in components
that know how to talk to printers via some standard protocols. These services serve as a
bridge between the system and the printers. Hence, the printer and print protocol specific
implementation is factored out of the system and can be independently developed and updated.
A print service implementation should extend PrintService
and implement its abstract methods. Also the print service has to follow the contract for
managing PrintJob
s.
The system is responsible for starting and stopping a print service depending on whether
there are active print jobs for the printers managed by the service. The print service
should also perform printer discovery in a timely fashion to ensure good user experience.
The interaction between the system and the print service during printer discovery is
encapsulated by a PrinterDiscoverySession
instance created
by the print service when requested by the system.
Classes
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# android.printservice\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nandroid.printservice\n====================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/printservice/package-summary \"View this page in Kotlin\") \\|Java\n\n\nProvides classes for implementing print services. Print services are plug-in components\nthat know how to talk to printers via some standard protocols. These services serve as a\nbridge between the system and the printers. Hence, the printer and print protocol specific\nimplementation is factored out of the system and can be independently developed and updated.\n\n\nA print service implementation should extend [PrintService](/reference/android/printservice/PrintService)\nand implement its abstract methods. Also the print service has to follow the contract for\nmanaging [PrintJob](/reference/android/printservice/PrintJob)s.\n\n\u003cbr /\u003e\n\n\nThe system is responsible for starting and stopping a print service depending on whether\nthere are active print jobs for the printers managed by the service. The print service\nshould also perform printer discovery in a timely fashion to ensure good user experience.\nThe interaction between the system and the print service during printer discovery is\nencapsulated by a [PrinterDiscoverySession](/reference/android/printservice/PrinterDiscoverySession) instance created\nby the print service when requested by the system.\n\nClasses\n-------\n\n|----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CustomPrinterIconCallback](/reference/android/printservice/CustomPrinterIconCallback) | Callback for [PrinterDiscoverySession.onRequestCustomPrinterIcon](/reference/android/printservice/PrinterDiscoverySession#onRequestCustomPrinterIcon(android.print.PrinterId,%20android.os.CancellationSignal,%20android.printservice.CustomPrinterIconCallback)). |\n| [PrintDocument](/reference/android/printservice/PrintDocument) | This class represents a printed document from the perspective of a print service. |\n| [PrinterDiscoverySession](/reference/android/printservice/PrinterDiscoverySession) | This class encapsulates the interaction between a print service and the system during printer discovery. |\n| [PrintJob](/reference/android/printservice/PrintJob) | This class represents a print job from the perspective of a print service. |\n| [PrintService](/reference/android/printservice/PrintService) | This is the base class for implementing print services. |\n\n-\n\n Classes\n -------\n\n - [CustomPrinterIconCallback](/reference/android/printservice/CustomPrinterIconCallback)\n - [PrintDocument](/reference/android/printservice/PrintDocument)\n - [PrinterDiscoverySession](/reference/android/printservice/PrinterDiscoverySession)\n - [PrintJob](/reference/android/printservice/PrintJob)\n - [PrintService](/reference/android/printservice/PrintService)"]]