lee
lee

Reputation: 129

How to get the PrinterDiscoverySession when using the printer in android 4.4

I am recently using the Printing Framework in Android 4.4, now I have a demand to get the printer's information which can be used in the Mobile phone or tablet.

I found the PrinterDiscoverySession class contains the printer's information. But how can I get the instance of the PrinterDiscoverySession class?

Upvotes: 1

Views: 1403

Answers (1)

ris8_allo_zen0
ris8_allo_zen0

Reputation: 1717

Seems like the Android printing API hides the printer details to the regular apps. Only a PrintService has this knowledge, but a PrintService is made to let other apps print: it doesn't print anything by itself - it's like a printer driver in the PC world.

The PrinterDiscoverySession is an abstract class implemented by a PrintService; it tells the PrintService when it's time to scan for the available printers in the network (wifi, bluetooth, cable, this is up to the PrintService implementation) and to report back the list of printers found. This list is only used by Android and its system activities, but never (AFAIK) shared with the apps.

Upvotes: 3

Related Questions