我想要做的是用zebra mz220打印标签,使用我的SQLite数据库中的信息,但是我不知道如何使用字符串填充标签。这是到目前为止我的代码从Android打印斑马MZ220
情况下R.id.bprint:
new Thread(new Runnable() {
public void run() {
try {
// Instantiate connection for given Bluetooth® MAC Address.
ZebraPrinterConnection thePrinterConn = new BluetoothPrinterConnection("00:22:58:3C:9F:0B");
// Initialize
Looper.prepare();
// Open the connection - physical connection is established here.
thePrinterConn.open();
// here it should fill in the label but it doesn't =(
thePrinterConn.write("Input (ENCODING.LBL):! 0 200 200 200 1 ENCODING UTF-8 TEXT 0 20 30 r/n/ PRINTr/n/".getBytes());
//Make sure the data got to the printer before closing the connection
Thread.sleep(500);
// Close the connection to release resources.
thePrinterConn.close();
Looper.myLooper().quit();
} catch (Exception e) {
// Handle communications error here
e.printStackTrace();
}
}
}).start();
break;
case R.id.spb:
startActivity(new Intent(this, Barcode.class));
break;
请帮忙,谢谢
欢迎#1。你到目前为止尝试了什么?我知道你是新人,但要记住,你的一些研究可以帮助你解决问题。你到目前为止尝试过什么吗?请先显示你的努力,以便其他人可以帮助你。此外,请阅读[常见问题](http://stackoverflow.com/help)和[如何问](http://stackoverflow.com/questions/how-to-ask) – kgdesouz