Android Question SerialLibJab Library Problem

kev128

New Member
Licensed User
i got the following message cause by declare a obj as SerialPort Class (Library: SerialLibJab), isn't any update version of SerialLibJab Library? (in order to connect RFID Reader through UART: "/dev/ttyS1")
===================================
Sub Activity_Create(FirstTime As Boolean)
Dim s1 As SerialPort
End Sub
===================================
Message:
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/b4a.example-vY_FkD0y5yBefYUDYBJ69g==/lib/arm/libserial_port.so" has text relocations (https://android.googlesource.com/pl...md#Text-Relocations-Enforced-for-API-level-23)
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1657)
at android_serialport_api.SerialPort.<clinit>(SerialPort.java:93)
at b4a.example.main._activity_create(main.java:380)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6753)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
** Activity (main) Resume **
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The library will work if you set targetSdkVersion to 22 or below. It needs to be updated to support newer targets (it will work on new devices).
https://www.b4x.com/android/forum/threads/87610/#content

What happens if you try to open a stream with:
B4X:
Dim out As OutputStream = File.OpenOutput("/dev/ttyS1", "", False)
 
Upvote 0

kev128

New Member
Licensed User
Hi Erel, i already try to use OutputStream Method, but i want to receive the serial port result by AsyncStreams Method, so i want to use the SerialLibJab Library, isn't any sample for using AsyncStreams with UART?

Thanks for your help!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…