简体   繁体   English

Java Midlet检测打印机

[英]Java midlet detecting printer

I am trying to incorporate an interface into my Midlet app to detect printers. 我正在尝试将接口合并到Midlet应用程序中以检测打印机。 Could be a couple of scenarios:- a. 可能有两种情况:-a。 Printers that has been added to the mobile. 已添加到移动设备的打印机。 b. b。 Detect blueetooth printers 检测蓝牙打印机

Thanks in advance. 提前致谢。

Scenario a) You might want to look at the blackberry APIs (just in case) but there is no JavaME standard for discovering printers on mobile phones. 场景a)您可能希望查看blackberry API(以防万一),但是没有JavaME标准可用于在手机上发现打印机。

Scenario b) JSR-82 (see www.jcp.org) is the specification for the JavaME Bluetooth API. 场景b)JSR-82(请参阅www.jcp.org)是JavaME Bluetooth API的规范。 Most JavaME SDKs have Bluetooth example code to get you started. 大多数JavaME SDK都有蓝牙示例代码,可以帮助您入门。

However, I have never heard of somebody even attempting to connect a mobile phone to a printer using JSR-82. 但是,我从未听说有人尝试使用JSR-82将手机连接到打印机。 If I remember correctly, bluetooth works when 2 devices have matching profiles (phone supporting keyboard profile connects to physical keyboard, headset profile connects to actual headset...) and I have never heard of a phone supporting a printer profile from JavaME code (although, that part, I could believe, depending on the phone). 如果我没记错的话,当2个设备具有匹配的配置文件(支持电话的键盘配置文件连接到物理键盘,耳机配置文件连接到实际的耳机...)并且我从未听说有电话支持JavaME代码中的打印机配置文件时,蓝牙才起作用。 ,我相信这部分取决于电话)。 The main issue here is probably going to be that the JSR-82 API will probably only let you send non-formatted binary data to any printer you connect to, which would mean that you would have to implement some kind of data transfer protocol in your JavaME code to allow the printer to understand what you want to print. 这里的主要问题可能是,JSR-82 API可能只会让您将未格式化的二进制数据发送到所连接的任何打印机,这意味着您将必须在自己的计算机上实现某种数据传输协议。 JavaME代码,允许打印机了解您要打印的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM