17

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
    Apr 16 '13 at 21:45
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. Apr 22 '13 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
    Apr 24 '13 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. Jun 5 '15 at 20:56
3

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
    May 22 '16 at 20:56
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

I think you could try Shared printer app from pelya available at play store. It is a cups installation for android. I hope it works for you.

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.
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.