I really don't know what's going on, though I suspect I did something wrong with the placement of 'so' files.
I used 'simpleLibraryCompiler (1.01)' and then I added just a void to perform printing. Lib is loaded, but upon run I get
Seems that a lib is missing, though I've added the brotherLib to both the additional folder of b4a and of my workspace. Yet, I'm not sure about the 'so' files.
The code of void goes like this, just in case anyone sees something wrong:
I'm almost sure, there is a simple solution, but can't figure it out
I used 'simpleLibraryCompiler (1.01)' and then I added just a void to perform printing. Lib is loaded, but upon run I get
B4X:
java.lang.UnsatisfiedLinkError: Couldn't load createdata from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/b4a.example-2.apk"],nativeLibraryDirectories=[/data/app-lib/b4a.example-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.brother.ptouch.sdk.PrinterModel.<clinit>(PrinterModel.java:30)
at com.brother.ptouch.sdk.Communication.createPrinterModel(Communication.java:275)
at com.brother.ptouch.sdk.ComNet$CommunicationThread.run(ComNet.java:473)
Seems that a lib is missing, though I've added the brotherLib to both the additional folder of b4a and of my workspace. Yet, I'm not sure about the 'so' files.
The code of void goes like this, just in case anyone sees something wrong:
B4X:
package biz.logismic;
import com.brother.ptouch.sdk.*;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
@Version(3.0f)
@ShortName("BrotherPrintSDK")
@DependsOn(values={"BrotherPrintLibrary"})
public class brotherSDK {
public void print(String filePath,String printerIP,String macAddress){
Printer myPrinter = new Printer();
PrinterInfo myPrinterInfo = new PrinterInfo();
PrinterStatus printResult = new PrinterStatus();
LabelInfo mLabelInfo=new LabelInfo();
try{
myPrinterInfo = myPrinter.getPrinterInfo();
myPrinterInfo.printerModel=PrinterInfo.Model.QL_710W;
myPrinterInfo.printMode=PrinterInfo.PrintMode.FIT_TO_PAGE;
myPrinterInfo.port=PrinterInfo.Port.NET;
myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM;
myPrinterInfo.orientation = PrinterInfo.Orientation.PORTRAIT;
myPrinterInfo.numberOfCopies = 1;
myPrinterInfo.ipAddress=printerIP;
myPrinterInfo.macAddress=macAddress;
mLabelInfo.labelNameIndex=LabelInfo.QL700.valueOf("W62").ordinal();
mLabelInfo.isAutoCut = true;
mLabelInfo.isEndCut =true;
myPrinter.setPrinterInfo(myPrinterInfo);
myPrinter.setLabelInfo(mLabelInfo);
printResult=myPrinter.printFile(filePath);
} catch(Exception e){
}}}
I'm almost sure, there is a simple solution, but can't figure it out