I am implementing Brother QL-710W android SDK into my Android Studio 0.8.9 project. I am able to connect to the printer via Wifi but when want to print, I got the following error:
10-24 14:08:03.809 11202-11368/android.mobile.battlehack.com.arrived D/dalvikvm﹕ Trying to load lib /data/app-lib/android.mobile.battlehack.com.arrived-1/libcreatedata.so 0x42283230
10-24 14:08:03.809 11202-11368/android.mobile.battlehack.com.arrived D/dalvikvm﹕ Added shared lib /data/app-lib/android.mobile.battlehack.com.arrived-1/libcreatedata.so 0x42283230
10-24 14:08:03.809 11202-11368/android.mobile.battlehack.com.arrived D/dalvikvm﹕ No JNI_OnLoad found in /data/app-lib/android.mobile.battlehack.com.arrived-1/libcreatedata.so 0x42283230, skipping init
10-24 14:08:04.810 11202-11202/android.mobile.battlehack.com.arrived I/arrived.arrived﹕ errorCode = ERROR_WRONG_LABEL
10-24 14:08:04.810 11202-11202/android.mobile.battlehack.com.arrived I/arrived.arrived﹕ labelWidth = 29
10-24 14:08:04.810 11202-11202/android.mobile.battlehack.com.arrived I/arrived.arrived﹕ paperWidth = 29.0
10-24 14:08:04.810 11202-11202/android.mobile.battlehack.com.arrived I/Choreographer﹕ Skipped 59 frames! The application may be doing too much work on its main thread.
My code are below:
public void printLabel(View view) {
Printer myPrinter = new Printer();
PrinterInfo myPrinterInfo = new PrinterInfo();
try {
myPrinterInfo.printerModel = PrinterInfo.Model.QL_710W;
myPrinterInfo.ipAddress = mNetPrinter[0].ipAddress;
myPrinterInfo.macAddress = mNetPrinter[0].macAddress;
myPrinterInfo.port = PrinterInfo.Port.NET;
myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM;
myPrinterInfo.printMode=PrinterInfo.PrintMode.FIT_TO_PAGE;
LabelInfo labelInfo = new LabelInfo();
labelInfo.labelNameIndex = 4;//LabelInfo.PT.valueOf("W24").ordinal();
labelInfo.isAutoCut = true;
labelInfo.isEndCut = true;
labelInfo.isHalfCut = false;
labelInfo.isSpecialTape = false;
myPrinter.setPrinterInfo(myPrinterInfo);
myPrinter.setLabelInfo(labelInfo);
File downloadFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
Log.i(TAG, "startCommunication = " + myPrinter.startCommunication());
//myPrinter.printPDF(downloadFolder.getAbsolutePath() + File.separator + "100.pdf", 1);
Boolean val = myPrinter.startPTTPrint(1, null);
myPrinter.replaceText("Mark Thien");
myPrinter.endCommunication();
Log.i(TAG, "val = " + val);
Log.i(TAG, "errorCode = " + myPrinter.getPrinterStatus().errorCode);
Log.i(TAG, "labelWidth = " + myPrinter.getLabelParam().labelWidth);
Log.i(TAG, "paperWidth = " + myPrinter.getLabelParam().paperWidth);
} catch(Exception e){
e.printStackTrace();
}
}
I have tried below URL but still got the error:
ERROR_WRONG_LABEL when trying to print wireless using Android Brother Sdk for label printer
I have put libAndrJFPDFEMB.so & libcreatedata.so into src/main/jniLibs/armeabi/folder
Appreciate anyone help please.
Mark