Android Printing API on Galaxy Tab

tgruben picture tgruben · Jan 2, 2011 · Viewed 8.8k times · Source

I would like to add wireless printing to my android 2.2 application which is targeted for the Galaxy tablet. I see that the internet browser has a print option so I am assuming that an activity hook must exist, and I was hoping that someone has figured this out. I have found a possibility using the PrinterShare application from Mobile Dynamix, but my preference would be to no require a 3rd party.

Here is the code example that they provide, just for reference.

Intent i = new Intent(Intent.ACTION_VIEW);
i.setPackage("com.dynamixsoftware.printershare");
i.setDataAndType(data_uri, data_type);
startActivity(i);

Where:

data_uri - Uri of the object to print, such as "file:///sdcard/something.pdf" or "content://something"

data_type - Mime type. The following mime types are supported: "application/pdf" "text/html" "text/plain" "image/png" "image/jpeg"

Answer

Peter Knego picture Peter Knego · Jan 2, 2011

Printing is not yet supported on Android. You have to use a 3rd party solution like Mobile Dynamix, HP iPrint for Android or Send2Printer.

Intents are described here:

http://www.openintents.org/en/node/735

http://www.openintents.org/en/node/278