Print from android without system dialog

梦想的初衷 提交于 2019-12-04 10:09:49

Short answer is unfortunately: no. The only way to use the Android provided print framework is to send the appropriate intent and the system's print spooler app will show the print preview and list of printers to choose from so you can't change that to make it print to the default printer. Also, the android framework does not directly discover or communicate to printers, instead it uses print services in the background to connect to the printer. "A print service must request the android.permission.BIND_PRINT_SERVICE permission to ensure that only the system can bind to it" so you cannot bind to a print service (assuming one is already installed on the device) to perform printing. So it looks like your only option if you don't want a UI to show is to implement connection and printing yourself. Also, how do you know there is a default printer or that it's currently available?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!