18

How to print from Android to CUPS (running on another computer in the LAN)?

(CUPS (Common Unix Printing System/Server) is of course already set up to accept requests over the LAN.)

Preferably, without relying on proprietary software.

1
  • 1
    without the help of other tools: unlikely. With the help of other tools: check "cups print" on Google Play. I was surprised there really seem to be any CUPS clients around -- didn't expect that...
    – Izzy
    Commented Apr 16, 2013 at 21:45

6 Answers 6

4

I have recently released an Android app based on (a modified) version of Cups4J. Communication is via http/https. The main thing I had to/opted to change from the java library was a dependency on JAXB for XML processing (a. I felt it too heavy b. Android does not have this javax lib and importing it apparently involves repackaging) relying instead on some hard coding.

Download Android CUPS Printing on the Play Store or get the sources on GitHub.

3
  • 3
    Have a look at f-droid.org and their forum which welcomes submission of open-source apps for Android. The community there--I hope--will be friendly enough to help you to package your source code in a nice manner, so that it is easy to read and reproduce your build procedure. If you wish to publish it, please, open a new topic at the forum there, and hopefully you'll get help and contributions (patches) from the community, so that your project will be enabled to live and develop further! A prerequisite is that you put your source code into Git. If I have time, I'll also try to help you. Commented Apr 22, 2013 at 14:27
  • 1
    Just noting. I still need to get my head round Git but for now everything I have done can be reached at mobd.jonbanjo.com/jfcupsprint/licence.php. There are 2 files, cups4jpatched.zip and jfcupsprint.zip
    – Jon
    Commented Apr 24, 2013 at 6:36
  • 3
    I took the liberty of taking the sources of this project, convert them to gradle and host them at github. All contributions welcome at: github.com/BenoitDuffez/JfCupsPrint (also, I added the print service so that you can add printers to Android directly). KitKat required. Commented Jun 5, 2015 at 20:56
4

You can now set up CUPS for IPP Everywhere. It should then directly show up in your Android, Chromebooks, and maybe even iPhone printer menus. The other answers are outdated for reasonably new systems: CUPS 1.5+ and Android 4.4+ or an IPP Everywhere printer is required. For Apple AirPrint CUPS 2.2.2 is required. Debugging the functionality can be a bit difficult though.

2

I have a USB printer attached to a Windows machine and my Linux server sees that over SMB and publishes that via CUPS (be sure to "share...".)

For Android, there's Let's Print Droid - complete with a print service so all apps see it. It takes about two minutes to set up.

1
  • I have a google/cups-connector printserver running on an Ubuntu computer (smb server on router). The chromebook prints fine from this network printer but this app was the only thing that would get it to print on android.
    – mchid
    Commented May 22, 2016 at 20:56
2

As already stated in other answers, the android system printing service can already access to cups printer (at least for android 10).

These are the steps I had to follow to make it work with debian buster since CUPS was not configured to accept LAN requests in my case.

On debian buster

Steps were taken from Sharing via Internet Printing Protocol @ wiki.ArchLinux.org

  1. go to the CUPS admin panel http://localhost:631/admin and check "Share printers connected to this system", then click on "Change settings"
  2. Edit /etc/cups/cupsd.conf so that your CUPS / is reachable from a local network address
<Location />
   Order allow,deny
   Allow localhost
   Allow 192.168.0.*
</Location>
...
  1. Edit /etc/cups/cupsd.conf either one of these ways

3a. so that your CUPS listens to the address at wich you call it

...
Listen <hostname>:631
...

3b. so that your CUPS listens to port 631 (whatever the address at wich you call it) remove the Listen localhost:631 line and add this one [3b. works better for me, since after a reboot, the solution 3a. didn't make the cups server reachable from anything else than localhost]

...
Port 631
...
  1. Restart CUPS daemon :
# systemctl restart cups

On an Android 10 phone (mine is xiaomi with miui 11)

  • Simply go to parameters / Connexion & sharing / Printing / System Printing Service (should be enabled)
  • be sure your phone is connected to the network where your CUPS server is reachable
  • Normally your printers should appear automagically
1
  • Confirming on Android 13 - the Default service picks CUPS printers shared over mDNS. Before reading this post I tried "Android CUPS Printing" (was detecting, not printing), PrintBot (was detecting and printing fine with IPP Everywhere). Commented Jan 16, 2023 at 20:28
1

It seems there are no native Android CUPS clients, which are free software.

The only way that can be found is rather clumsy, via a Debian installation on the Android device -- http://code.google.com/p/android/issues/detail?id=1148#c41. But using a Debian (or another distro) installation like LilDebi (for example) would definitely require root (in order to chroot)! That's not convenient for those who don't want to root the device (just to be able to print). (BTW, aren't there, besides chroot, any more modern alternative isolation technologies implemented in Linux that wouldn't require root?.. Perhaps, LXC?)

Another app (Remote CUPS) requires SSH access to the server.

ObPrint doesn't appear to be open-source.

Let's Print Droid likewise doesn't appear to be open-source.

1

For newer Android versions, CUPS printers are found by the standard print service, so no extra plugin or app has to be installed.

  • Share the printer in CUPS
  • Turn on print service in Android (search print service in settings)
  • CUPS printers should be found automatically. Tested on Android 10.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .