I tried to work via android serial-api, jssc with a serial port in Android, and in any case I have a problem:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "tcgetattr" referenced by "libjssc.so"... 

I'm not special with C ++, and google about tcgetattr. Here is what I found:

tcgetattr (): get the parameters associated with the object referenced by fd and store them in the termios structure referenced by termios_p. This function can be run from a background process; however, the attributes of the terminal can be further modified by the main process.

tcsetattr (): changes the parameters associated with the terminal (if support is needed for used equipment that is not available) and the parameters of the termios structure associated with termios_p. In order for the changes to take effect, you must specify optional_actions:

That is, it sets the com-port settings, and are necessary for operation. At the same time, termios.h is present in all versions of Android, including 4.2.2 (c: \ AndroidSdk \ ndk-bundle \ platforms \ android-17 \ arch-arm \ usr \ include \ termios.h) that interests me, and compiles without problems.

Help me figure out what's wrong with versions prior to 5.0?

    1 answer 1

    There in API 21 a lot of things have changed in terms of NDK.

    .so'shki collected under 21 may simply not work on a device with API 19. Try building a project under API 19.

    • that is, targetSDK make 19? - Eugene
    • @Eugene yes, in Android.mk, if you use it. - Suvitruf
    • I have a gradle-experimental. I put in app.xml, model.adroid.ndk.platformVersion "= 17". Do you need it there? It did not change anything. - Eugene
    • @Eugene yes, probably there. I just worked with NDK for the last time when there was no Studio yet. Then only with the help of Android.mk you could do it. Did you delete the old generated .so files before this? - Suvitruf