Java Question SimpleLibraryCompiler for brither print2

buras3

Active Member
Licensed User
Longtime User
Hey
can some help me
i get
error: cannot find symbol
ba.raiseEventFromDifferentThread(this , null, 0, "eventName" + "_metadata", true, new Object[] {printResult.errorCode.toString()});
^

B4X:
package michael.vegs;
import com.brother.ptouch.sdk.*;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;

@Version(3.0f)
@ShortName("BrotherPrintSDK")
@DependsOn(values={"BrotherPrintLibrary"})
public class BrotherPrintSDK {
  
   public void print( final String filePath,final String printerIP){
      
                    Thread trd = new Thread(new Runnable(){
     @Override
       public void run() {
     Printer myPrinter = new Printer();
     PrinterInfo myPrinterInfo = new PrinterInfo();
     PrinterStatus printResult = new PrinterStatus();
     LabelInfo mLabelInfo=new LabelInfo();
    
    
       myPrinterInfo = myPrinter.getPrinterInfo();
       myPrinterInfo.printerModel=PrinterInfo.Model.QL_720NW;
      
       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;
        //myPrinter.skipStatusCheck=true;
     mLabelInfo.labelNameIndex=LabelInfo.QL700.valueOf("W29H90").ordinal();
       //mLabelInfo.labelNameIndex=5;
       mLabelInfo.isAutoCut = true;
       mLabelInfo.isEndCut =true;
      
       myPrinter.setPrinterInfo(myPrinterInfo);
       myPrinter.setLabelInfo(mLabelInfo);

    
       printResult=myPrinter.printFile(filePath );
       ba.raiseEventFromDifferentThread(this , null, 0,  "eventName" + "_metadata", true, new Object[] {printResult.errorCode.toString()});
     //      }
       }
        });
        trd.start();
                    }
        }
 

buras3

Active Member
Licensed User
Longtime User
Tank you Erel

Can you tell me how can I show the error code -
printResult.errorCode.toString()
In ba ?

then error now is unknown "metadata" because I copied it and i don't know how to raise/show the
"eventName" + "_metadata" part
 

buras3

Active Member
Licensed User
Longtime User
the event is raising ok

when I add ba.log
I get "cannot find symbol"
I tried
ba.log()
ba.log("","")
ba.log 1
ba.log "1"

how to write it?
 

buras3

Active Member
Licensed User
Longtime User
so how this is working : ba.raiseEventFromDifferentThread
and this not ba.log("test");
?
 

buras3

Active Member
Licensed User
Longtime User
maybe that is the problem with the socket error ? I need to import for network?
this is the imports
B4X:
import com.brother.ptouch.sdk.*;

import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
 

buras3

Active Member
Licensed User
Longtime User
this is the log i get
i have tried to fix the fatal signal with CallSubDelayed
but it's the same

B4X:
LogCat connected to: B4A-Bridge: samsung GT-P7300B
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
** Activity (cust) Pause, UserClosed = false **
sending message to waiting queue (myevent_metadata)
PackageAdded: package:com.facebook.orca
Fatal signal 11 (SIGSEGV) at 0x401f3088 (code=1)
sending message to waiting queue (myevent_metadata)
Fatal signal 11 (SIGSEGV) at 0x401a1088 (code=1)
Killing previous instance (main).
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Fatal signal 11 (SIGSEGV) at 0x401ad088 (code=1)
** Activity (main) Pause, UserClosed = false **
running waiting messages (2)
** Activity (cust) Resume **
Installing file.
** Activity (cust) Pause, UserClosed = false **
PackageAdded: package:michael.vegs
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (cust) Create, isFirst = true **
** Activity (cust) Resume **
 

buras3

Active Member
Licensed User
Longtime User
I don't know how but I reinstall the printer and it's working!!
no change with the code
Tank you very much
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…