Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. MySql and Android
Forum Updated to NodeBB v4.3 + New Features

MySql and Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 2 Posters 866 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RenanHm
    wrote on 17 Oct 2022, 13:11 last edited by
    #1

    Hello.. Any updates on the MySql plugin on Android?

    I managed to compile the MySql plugin... but when the lib is added to the Android project, there is an APP execution error. He follows:

    ANDROID_EXTRA_LIBS += C:\mysqlarm64\lib\libmysqlclient.so

    The application opens and closes with error. It does not report the error.

    Am I using the wrong MySql library?
    I downloaded the files from: https://dev.mysql.com/downloads/mysql/5.5.html?os=31&version=5.1

    Is there already any solution to access MySQL from Android?

    J 1 Reply Last reply 17 Oct 2022, 14:17
    0
    • R RenanHm
      17 Oct 2022, 13:11

      Hello.. Any updates on the MySql plugin on Android?

      I managed to compile the MySql plugin... but when the lib is added to the Android project, there is an APP execution error. He follows:

      ANDROID_EXTRA_LIBS += C:\mysqlarm64\lib\libmysqlclient.so

      The application opens and closes with error. It does not report the error.

      Am I using the wrong MySql library?
      I downloaded the files from: https://dev.mysql.com/downloads/mysql/5.5.html?os=31&version=5.1

      Is there already any solution to access MySQL from Android?

      J Online
      J Online
      jsulm
      Lifetime Qt Champion
      wrote on 17 Oct 2022, 14:17 last edited by
      #2

      @RenanHm said in MySql and Android:

      Is there already any solution to access MySQL from Android?

      I'm wondering what the use case is? Why do you want to access MySql server directly from an Android app?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RenanHm
        wrote on 17 Oct 2022, 14:52 last edited by
        #3

        Good Morning. I know the safest way is through a RES API or webservice. But in this specific case I need to connect directly to MySql through Android.

        J 1 Reply Last reply 17 Oct 2022, 14:55
        1
        • R RenanHm
          17 Oct 2022, 14:52

          Good Morning. I know the safest way is through a RES API or webservice. But in this specific case I need to connect directly to MySql through Android.

          J Online
          J Online
          jsulm
          Lifetime Qt Champion
          wrote on 17 Oct 2022, 14:55 last edited by
          #4

          @RenanHm Did you try to remote debug your app on Android to get more information about the issue?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply 19 Oct 2022, 22:17
          0
          • R Offline
            R Offline
            RenanHm
            wrote on 17 Oct 2022, 16:43 last edited by
            #5

            Hello.. so, I use QT 5.14.2 and Windows 10.

            I have successfully compiled the MySql plugin:

            projeto.png

            The file "libplugins_sqldrivers_qsqlmysql_arm64-v8a.so" is generated successfully.

            When fetching the drivers through the function " QStringList drivers = QSqlDatabase::drivers();
            " the driver "QMYSQL" is successfully found.

            But when adding the library "libmysqlclient.so" an error occurs when opening the APP on Android.
            No error appears. Simply open and immediately close the APP.

            Now I ask: Is it possible to generate the plugin this way?
            Is the MySql library correct? Or should other files be included as well?
            Or just using MariaDB for MySQL access? (But I didn't find the arm64 libraries for MariaDB).

            1 Reply Last reply
            0
            • J jsulm
              17 Oct 2022, 14:55

              @RenanHm Did you try to remote debug your app on Android to get more information about the issue?

              R Offline
              R Offline
              RenanHm
              wrote on 19 Oct 2022, 22:17 last edited by
              #6

              @jsulm Is there a way to debug this error??

              1 Reply Last reply
              0
              • R Offline
                R Offline
                RenanHm
                wrote on 19 Oct 2022, 22:32 last edited by
                #7

                I managed to debug.. it returns me the following error:

                I Qt : qt started
                E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
                E AndroidRuntime: Process: com.digitalsof.totallocapp, PID: 29087
                E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==/com.digitalsof.totallocapp-OqCdR438GzfaRWbmqFz5wg==/lib/arm64/libmysqlclient.so in namespace classloader-namespace
                E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:929)
                E AndroidRuntime: at java.lang.System.load(System.java:1625)
                E AndroidRuntime: at org.qtproject.qt5.android.QtNative$3.run(QtNative.java:239)
                E AndroidRuntime: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
                E AndroidRuntime: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
                E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
                19:30:21: Debugging has finished

                "com.digitalsof.totallocapp" died.

                Help??

                J 1 Reply Last reply 20 Oct 2022, 05:40
                0
                • R RenanHm
                  19 Oct 2022, 22:32

                  I managed to debug.. it returns me the following error:

                  I Qt : qt started
                  E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
                  E AndroidRuntime: Process: com.digitalsof.totallocapp, PID: 29087
                  E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==/com.digitalsof.totallocapp-OqCdR438GzfaRWbmqFz5wg==/lib/arm64/libmysqlclient.so in namespace classloader-namespace
                  E AndroidRuntime: at java.lang.Runtime.load0(Runtime.java:929)
                  E AndroidRuntime: at java.lang.System.load(System.java:1625)
                  E AndroidRuntime: at org.qtproject.qt5.android.QtNative$3.run(QtNative.java:239)
                  E AndroidRuntime: at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:87)
                  E AndroidRuntime: at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
                  E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012)
                  19:30:21: Debugging has finished

                  "com.digitalsof.totallocapp" died.

                  Help??

                  J Online
                  J Online
                  jsulm
                  Lifetime Qt Champion
                  wrote on 20 Oct 2022, 05:40 last edited by
                  #8

                  @RenanHm said in MySql and Android:

                  E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==

                  This is your issue. I'm not an Android expert, so do not know whether Android provides pthread library. Try to deploy it with your application.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  R 1 Reply Last reply 20 Oct 2022, 13:02
                  0
                  • J jsulm
                    20 Oct 2022, 05:40

                    @RenanHm said in MySql and Android:

                    E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libpthread.so.0" not found: needed by /data/app/~~JWWP6Bwj6ZX5zMzQ0Fn3_g==

                    This is your issue. I'm not an Android expert, so do not know whether Android provides pthread library. Try to deploy it with your application.

                    R Offline
                    R Offline
                    RenanHm
                    wrote on 20 Oct 2022, 13:02 last edited by
                    #9

                    @jsulm Hello.. Okay. But where to find this "libpthread.so.0" arm64 library? I'm looking on Google and I didn't find it.. only 64-bit versions for linux distributions.
                    MySql files do not have this library.

                    J 1 Reply Last reply 21 Oct 2022, 05:34
                    0
                    • R RenanHm
                      20 Oct 2022, 13:02

                      @jsulm Hello.. Okay. But where to find this "libpthread.so.0" arm64 library? I'm looking on Google and I didn't find it.. only 64-bit versions for linux distributions.
                      MySql files do not have this library.

                      J Online
                      J Online
                      jsulm
                      Lifetime Qt Champion
                      wrote on 21 Oct 2022, 05:34 last edited by
                      #10

                      @RenanHm As I wrote: I do not know whether this lib is distributed with Android. But you can check in Android NDK or directly on Android device.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      R 1 Reply Last reply 21 Oct 2022, 13:39
                      0
                      • J jsulm
                        21 Oct 2022, 05:34

                        @RenanHm As I wrote: I do not know whether this lib is distributed with Android. But you can check in Android NDK or directly on Android device.

                        R Offline
                        R Offline
                        RenanHm
                        wrote on 21 Oct 2022, 13:39 last edited by
                        #11

                        @jsulm Hello.. unfortunately I can't find it.. it's not inside the Android NDK and it's not inside my Android phone.
                        Searching a lot on Google I find only .RPM packages from some linux distributions. I do not know what to do.

                        1 Reply Last reply
                        0

                        1/11

                        17 Oct 2022, 13:11

                        • Login

                        • Login or register to search.
                        1 out of 11
                        • First post
                          1/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved