Printing with android without a system dialog

I would like to print an image from an Android application (printer: canon selphy cp910 with direct Wi-Fi). I tried the Google API with the class android.support.v4.print.PrintHelper. It works, but I can not get around the system dialog. I would like the application not to interact with the user interface of the system.

just print the button and start printing to the default printer.

Is it possible?

thanks

+5
source share
1 answer

The short answer, unfortunately: no. The only way to use the printing platform provided for Android is to send the appropriate intention, and the print spooler application will display a print preview and a list of printers to choose from so that you can’t change this to print to the default printer. In addition, the Android infrastructure does not directly detect or communicate with the printer; instead, it uses print services in the background to connect to the printer. "The print service must request permission from android.permission.BIND_PRINT_SERVICE to ensure that only the system can bind to it," so you cannot bind to the print service (provided that it is already installed on the device) to print. Thus, it looks like your only option if you do not want the user interface to show in order to implement the connection and print itself. Also, how do you know if there is a default printer, or is it currently available?

+1
source

Source: https://habr.com/ru/post/1204648/


All Articles