我想要做的是用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