Galaxy Tab 上的 Android 打印 API [英] Android Printing API on Galaxy Tab
问题描述
我想为我的 android 2.2 应用程序添加无线打印功能,该应用程序是针对 Galaxy 平板电脑的.我看到互联网浏览器有一个打印选项,所以我假设必须存在一个活动挂钩,我希望有人已经解决了这个问题.我发现可以使用 Mobile Dynamix 的 PrinterShare 应用程序,但我更喜欢不需要第 3 方.
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);
地点:
data_uri - 要打印的对象的 Uri,例如file:///sdcard/something.pdf"或content://something"
data_uri - Uri of the object to print, such as "file:///sdcard/something.pdf" or "content://something"
data_type - Mime 类型.支持以下 MIME 类型:申请/pdf"文本/html"文本/纯文本"图像/png"图像/jpeg"
data_type - Mime type. The following mime types are supported: "application/pdf" "text/html" "text/plain" "image/png" "image/jpeg"
推荐答案
Android 尚不支持打印.您必须使用第三方解决方案,例如 Mobile Dynamix,HP iPrint for Android 或 Send2Printer.
Printing is not yet supported on Android. You have to use a 3rd party solution like Mobile Dynamix, HP iPrint for Android or Send2Printer.
此处描述了意图:
http://www.openintents.org/en/node/735
http://www.openintents.org/en/node/278
这篇关于Galaxy Tab 上的 Android 打印 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!