1

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Krisztián Nagy
  • 132
  • 1
  • 10
  • 1
    Android's print framework does not support that, sorry. – CommonsWare Mar 18 '22 at 12:05
  • Ok it may not support that but isn't there a way around it? Maybe with root access? My goal is to be able to just send a print command to an embedded android device that will instantly print whatever it received and I already researched and know how to do anything besides the printing without a prompt part – Krisztián Nagy Mar 20 '22 at 17:31
  • 1
    You are welcome to talk to the printer directly, using whatever protocol the printer supports. The Android print framework is designed for ordinary people and puts those people in control over the printing. – CommonsWare Mar 20 '22 at 18:02

1 Answers1

0

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.

Krisztián Nagy
  • 132
  • 1
  • 10