Android Question Print Serial (Internal Printer)

cssinformatica

Member
Licensed User
Hi,
I have a Android PDA with internal Termal Printer.
I've a SDK and I've create lib file for use it in B4A.

I use this code:

Dim mprint As Kt45Printer

mprint = mprint.InstancePrinter(GetContext)
mprint.PrintString("Ciao")

Sub GetContext As JavaObject
Return GetBA.GetField("context")
End Sub

Sub GetBA As JavaObject
Dim jo As JavaObject
Dim cls As String = Me
cls = cls.SubString("class ".Length)
jo.InitializeStatic(cls)
Return jo.GetFieldJO("processBA")
End Sub

but when the debugger declare mprint variable the application are closed with the error:

java.lang.InstantiationException: can't instantiate class anywheresoftware.b4a.sample.Kt45Printer; no empty constructor
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1215)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:591)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:357)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:166)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4463)
at android.view.View$PerformClick.run(View.java:18770)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5292)
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:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)

Please help me!

Link for SDK: www.edox.it/download/Kt45Printer_SDK.zip
 

Attachments

  • Kt45Printer_lib.zip
    7.6 KB · Views: 237
  • IMG_20171228_111901.png
    247.3 KB · Views: 202

Martin Fdez

Member
Licensed User
Longtime User
Hi
There is any solution for this??
I have a 3nstar android pda with the internal printer and no idea how to connect and send data to print.
Somebody can help?

Thanks
 

Attachments

  • 20180613_213143.jpg
    291.4 KB · Views: 215
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…