Im working on a kiosk app, and I must print on an USB connected printer (NP-F3692).
I want to use the manufacturer's lib Called "NPrinterLib.jar":
But when I Call a function:
I see this error:
The function and function arguments seems good.
Can Help Me?
I want to use the manufacturer's lib Called "NPrinterLib.jar":
B4X:
#Region Project Attributes
#ApplicationLabel: Nii Print
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger: True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#AdditionalJar: NPrinterLib
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
'Dim Ni As NPrinterLib
Dim NiOBJ As JavaObject
Dim M As JavaObject
End Sub
But when I Call a function:
B4X:
Sub OpenPrinter
Dim R As Object
M = NiOBJ.Initializestatic("npi.sdk.NPrinterLib") 'Initialized OK
Log(NiOBJ.IsInitialized)
R = M.RunMethod ("NOpenPrinter", Array("PrinterName", False))
'Log (R)
End Sub
I see this error:
B4X:
Logger connected to: HARDKERNEL Co., Ltd. ODROID-XU3
--------- beginning of /dev/log/main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
true
main_openprinter (java line: 545)
java.lang.IllegalArgumentException: expected receiver of type npi.sdk.NPrinterLib, but got java.lang.Class<npi.sdk.NPrinterLib>
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:131)
at asisoft.nii.print.main._openprinter(main.java:545)
at asisoft.nii.print.main._cmdopen_click(main.java:390)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:176)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
--------- beginning of /dev/log/system
The function and function arguments seems good.
Can Help Me?