我正在尝试在我的应用程序中使用Brother SDK打印图像。
这是我的代码:
`myPrinterInfo = myPrinter.getPrinterInfo();
myPrinterInfo.printerModel = PrinterInfo.Model.QL_810W;
myPrinterInfo.port = PrinterInfo.Port.NET;
myPrinterInfo.printMode = PrinterInfo.PrintMode.FIT_TO_PAGE;
myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM;
myPrinterInfo.labelNameIndex = 5;
myPrinterInfo.isAutoCut = false;
myPrinterInfo.isCutAtEnd = false;
myPrinterInfo.orientation = PrinterInfo.Orientation.PORTRAIT;
myPrinterInfo.valign = PrinterInfo.VAlign.TOP;
myPrinterInfo.align = PrinterInfo.Align.LEFT;
myPrinterInfo.halftone = PrinterInfo.Halftone.THRESHOLD;
myPrinterInfo.ipAddress = "192.168.1.146";
myPrinterInfo.thresholdingValue = 127;
myPrinterInfo.pjCarbon = false;
myPrinterInfo.pjDensity = 5;
myPrinterInfo.pjFeedMode = PrinterInfo.PjFeedMode.PJ_FEED_MODE_FIXEDPAGE;
myPrinterInfo.pjPaperKind = PJ_CUT_PAPER;
myPrinterInfo.rollPrinterCase = PrinterInfo.PjRollCase.PJ_ROLLCASE_OFF;
myPrinterInfo.paperPosition = PrinterInfo.Align.CENTER;
myPrinterInfo.numberOfCopies = 1;
我正在使用62mmx100mm的纸卷,但出现了以下错误信息:
JNI检测到应用程序错误:GetStringUTFChars收到空jstring 在调用GetStringUTFChars时发生错误,来自com.brother.ptouch.sdk.JNIWrapper.writeByteInFile(int[],int,java.lang.String,boolean)的布尔值 "AsyncTask#1" prio = 5 tid = 10可运行 | group="main" sCount=0 dsCount=0 obj=0x12c99460 self=0xe9594500 | sysTid=31584 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0xe0b65930 | state=R schedstat=( 80462688 29252686 258 ) utm=5 stm=3 core=2 HZ=100 | stack=0xe0a63000-0xe0a65000 stackSize=1038KB | held mutexes= "mutator lock"(shared held) 本机:#00 pc 0035adcf /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiPKcPNS_9ArtMethodEPv+126) 本机:#01 pc 0033bdeb /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+138) 本机:#02 pc 0024ef71 /system/lib/libart.so (ZN3art9JavaVMExt8JniAbortEPKcS2+900) 本机:#03 pc 0024f607 /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+54) 本机:#04 pc 000fbe5d /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+28) 本机:#05 pc 001003b9 /system/lib/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE.constprop.95+2676) 本机:#06 pc 00108cd5 /system/lib/libart.so (_ZN3art8CheckJNI17GetStringUTFCharsEP7_JNIEnvP8_jstringPh+376)如果有人知道如何修复它,请帮助我 :(