Android TSC thermal label printer printing

I don't know if you have encountered this situation. Some things want to be sorted out, but you don't know how to sort them out. Before doing it, I was confused. I couldn't find the answer on Baidu. Then I found that there was nothing to sort out, so there seemed to be nothing to sort out.

But more, what I want to say is that we still have to learn to summarize. Why did I spend so long and how can I start next time? I also hope it will be helpful to dishes like you and me.

Android Bluetooth connection TSC label printer printing. (thermal paper shall be used for thermal printer)

For printers, SDK and development documents are generally provided. Android can be used as a reference. In fact, it may be a very simple thing for many people, but it is inevitable to encounter some accidents.

In fact, I was a little confident at the beginning. Then I copied the jar package to the Lib folder, and then copied the code provided in the document to Android. The result: it failed. Collapse

Then I started my way of finding problems... All kinds of tests, mostly by luck

Sometimes this is not a code problem. A toolkit will be provided during development to correct the sensor (there is no printer connected here. Read the status and connect the printer before operation)

Note whether there is / R / N after your instruction. The instruction can be segmented and executed with / R / N at the end

I don't know if there are any specific settings here, but I have achieved the effect by other ways, dividing and printing the original string

At the beginning, I also read the document. When printing text, I can select the corresponding font for printing. First, ensure that the printer has a font that supports Chinese (use a tool to transfer the font to the printer), and then call it. According to this idea, a series of operations still can not solve the problem of Chinese garbled code

In fact, the operation is not to directly transfer Chinese, but to convert the text to byte [] type for submission

This is to go back and sort it out in two months. I don't know if there is anything missing. Although it seems to be a very simple function. But this is a project connected from the outside. We encountered a series of configuration problems (for example, we used to refer to the V4 package, but now we are unified with Android x), then to the reading of printed documents (still in English), debugging according to the demo provided, a series of problems encountered, and the anxiety that we couldn't find the answer on Baidu (also found the official website). Then let yourself calm down again and again to read the reference documents... It was made years ago and was already in use when I went to the customer years later. At that time, I didn't recognize it at first sight. At that moment, I lost my sense of achievement

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>