androidprintingandroid-print-frameworkandroid-print-manager

How do I print programatically on android without the prompt where you have to choose a printer?


I've been trying to find a solution to this issue all day but I haven't come across anything and android has no documentation related to this. Normally when you print something programmatically following the instructions within the documentation, a screen will pop up on the device where you have to select a printer you want to use and which pages you want to print. Seems like this is a built-in feature of the print manager class.

I'm trying to find a solution that lets me directly print on the default connected printer without this screen popping up.


Solution

  • So I figured out a way around this issue. The printer I was using is a standard ESC/POS printer and it supports Bluetooth, so I looked up documentation on this and I just had to directly write the commands and text it needs as byte arrays into the Bluetooth output stream and that way it can print without any user interaction on the device. I assume this is also possible using cable or network connection too as long as you write into the necessary output streams.