如何将 Android 平板电脑中的数据打印到蓝牙打印机
我正在为 Android 平板电脑开发一个应用程序,现在在我的应用程序中,如果我选择打印选项,那么数据应该在蓝牙打印机中打印。为了首先实现这一点,我想知道如何识别最近的蓝牙设备以及如何在蓝牙打印机中打印数据蓝牙打印机。
I am developing an application for Android Tablet,now in my application if i select print option then data should be print in the Bluetooth printer.to achieve this first i want to know how to recognize nearest Bluetooth devices and also how to print data in a Bluetooth printer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否看过任何 Android 蓝牙文档?
Have you looked at any of the Android Bluetooth Documentation?
Star Micronics 拥有一个用于通过蓝牙(以及以太网和 USB)进行 Android 打印的 SDK。您可以在此处下载:http://www.starmicronics.com/support/SDKDocumentation.aspx。
目前,Android 操作系统不支持通过蓝牙进行本机打印。
根据我的经验,最好使用 API 而不是外部应用程序。最大的原因是您可以完全控制打印机的行为。如果 API 是智能构建的,那么这也很容易。使用外部应用程序是有限制的,因为您无法按照您想要的方式自定义打印输出。
我链接到的 Star SDK 有一个非常好的示例应用程序,可让您测试和自定义许多打印机功能以查看它们的实际情况。每个函数都记录在源代码中。命令及其参数也可以在应用程序本身中作为屏幕上的快速参考,非常方便。最重要的是,它有详细的记录。
如果选择这种方式,您可以将纯文本与命令一起发送到打印机。 API 负责将数据转换为打印机可以理解的内容。
Star Micronics has an SDK for Android printing via Bluetooth (as well as ethernet and USB). You can download it here: http://www.starmicronics.com/support/SDKDocumentation.aspx.
At this point in time, the Android OS doesn't support native printing over Bluetooth.
In my experience, it's best to use an API and not an external application. The biggest reason is you get total control over printer behavior. It's easy too if the API is built intelligently. Using an external app is limiting because you can't customize your print outs the way you want to.
The Star SDK I linked you to has a really nice sample app that lets you test and customize a lot of printer functions to see them in action. Each function is documented in the source code. The commands and their parameters are also available in the app itself as a quick on screen reference which is convenient. On top of all that, it's well documented.
If you choose this way, you can send plain text to the printer along with commands. The API handles converting the data into what the printer can understand.