简体   繁体   English

蓝牙或WiFi热敏打印机

[英]Bluetooth or WiFi Thermal Printer

I want to print token number from my android application using WiFi or Bluetooth. 我想使用WiFi或蓝牙从我的Android应用程序打印令牌号。 I have implemented PrintManager API but the problem is that after click on print it is asking to choose printer from list of printer. 我已经实现了PrintManager API,但问题是点击打印后要求从打印机列表中选择打印机。 My requirement is that once I choose or configured printer with app it should not ask again to choose printer. 我的要求是,一旦我选择或配置打印机与应用程序,它不应该再次要求选择打印机。 My questions are below - 我的问题如下 -

  1. Is that possible using PrintManager API? 可以使用PrintManager API吗?
  2. I am ready to use thermal printer . 我准备使用热敏打印机了。 Which manufacturer provide thermal printer with SDK or sample code? 哪家厂商为热敏打印机提供SDK或示例代码?

To answer (2) you can give StarMicronics a try, it comes with bunch of sample code for different platforms. 要回答(2)你可以试试StarMicronics ,它附带了不同平台的大量示例代码。 The way we do is to configure the MAC address of the printer somehow (Restful API, database, etc.) and try to find the printer's IP (on the first use) and cache it for subsequent uses. 我们采取的方式是以某种方式配置打印机的MAC地址(Restful API,数据库等)并尝试查找打印机的IP(首次使用时)并将其缓存以供后续使用。

For (1), I had no practical experience with PrintManager, but normally the app contact printer via SDK. 对于(1),我没有使用PrintManager的实际经验,但通常是app通过SDK联系打印机。 There are abstract layer (in case you need to work with another printer's vendor) such as JavaPOS . 有抽象层(如果您需要与其他打印机的供应商合作),例如JavaPOS

Follow Any Blue Printer or Any Network Printer SKD you said that Already Have Printer SDK 关注任何蓝色打印机或任何网络打印机SKD你说已经有打印机SDK

Then Go the Find Printer/Printer Discovery file after Finding Printer 然后在查找打印机后查找“查找打印机/打印机发现”文件

Just Save the Printer Credentials with Shared Preference 只需使用共享首选项保存打印机凭据

and At next Run Always choose Shared preference.. if there is no Printer get start your Find Printer 并在下次运行时始终选择共享首选项..如果没有打印机,请启动查找打印机

For Additional Details Give Your Printer SDK Link I will Update Shared preference in it 其他详细信息提供您的打印机SDK链接我将更新其中的共享首选项

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

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