Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Printing API on Galaxy Tab

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"

like image 761
tgruben Avatar asked Jan 02 '11 19:01

tgruben


1 Answers

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

like image 170
Peter Knego Avatar answered Nov 02 '22 19:11

Peter Knego