See znote's post below to get this to work with the latest version of python. I'll update the how to to reflect the changes later. Right now I just don't have time.
This tutorial will allow you to print from anywhere to your home printer using your android device via Google Cloud Print for Linux.
It is best to set this up on a home server or another computer that runs all the time, as the printer will only be "online" when your computer is running.
You can use either a wired or wireless printer, or a network printer.
I did not make this script, I just tested it out using instructions found from various other pages (see references below,) and this is how I did it.
Credit goes to wasserkapf at the xdadevelopers forum for most of the instruction.
Before beginning ensure that the printer that you want to share is set up in Ubuntu and that you can actually print from it. If this is not the case this tutorial won't work.
***Set up your Ubuntu box to use Google Cloud Print***
Use GIT to download the source. To use GIT, you first need it installed. You also need python and python-cups installed
Now use git to download the source code to your home folderCode:sudo apt-get install git-core python python-cups
change permissions of the downloaded folderCode:git clone git://github.com/armooo/cloudprint.git
Now change directory to the cloudprint folderCode:chmod -R 777 ~/cloudprint
run the setup.py scriptCode:cd ~/cloudprint
Now install Google Cloud Print for LinuxCode:python setup.py build
This installed the script in this folderCode:sudo python setup.py install
Run it and it will ask for your Gmail address and password
It will also add your default printer.Code:python /usr/local/lib/python2.6/dist-packages/cloudprint/cloudprint.py
You can manage your printers at the following address.
***Set Up your Android Device***
There are two programs that you can use to do this. I prefer "PrinterShare", but you can also use "Cloud Print". PrinterShare (free version) does not allow you to print directly to your networked printer without going through Google Cloud Print. I find the delay minimal and out-weigh the advertisements in the Cloud Print program.
go to your market app and search for either "PrinterShare" or "Cloud Print" and install. Or you can use the links below.
Both programs are easy to set up.
To print use your "Share" button on your Android device and select "PrinterShare" or "Cloud Print"