对Galaxy Tab的Andr​​oid的打印APITab、Galaxy、Andr、API

2023-09-12 09:19:51 作者:苏染°

我想无线打印加入到这是针对银河平板电脑我的Andr​​oid 2.2应用程序。我看到的互联网浏览器具有打印选项,所以我假定一个活动吊钩必须存在,而且我希望有人已经想通了这一点。我发现利用手机DYNAMIX上了PrinterShare应用程序中的可能性,但我的preference就没有要求第三方。

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.

下面是code例如他们提供,仅供参考。

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 - 乌里对象打印的,如文件:///sdcard/something.pdf或内容://什么

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

DATA_TYPE - MIME类型。以下MIME类型支持: 应用程序/ PDF text / html的 text / plain的 图像/ PNG 为image / jpeg

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

推荐答案

印刷尚不支持Android上。你必须使用像手机DYNAMIX,HP iPrint的Andr​​oid版或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