Android Question SerialLibJab Library Problem

Discussion in 'Android Questions' started by kev128, Apr 21, 2018.

  1. kev128

    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 **
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. kev128

    kev128 New Member Licensed User

  4. Erel

    Erel Administrator Staff Member Licensed 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:
    Code:
    Dim out As OutputStream = File.OpenOutput("/dev/ttyS1"""False)
     
  5. kev128

    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!
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The next step after opening the OutputStream is to pass it to AsyncStreams. You don't need any special library for this.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice