跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. Mobile and Embedded
  4. Qt Android client for Postresql
Forum Updated to NodeBB v4.3 + New Features

Qt Android client for Postresql

已排程 已置頂 已鎖定 已移動 Mobile and Embedded
35 貼文 4 Posters 10.8k 瀏覽 1 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • M 離線
    M 離線
    mbnoimi
    寫於 最後由 編輯
    #1

    Hi,

    I've Qt client works fine under Linux & Windows desktops but when I deployed it under Android it didn't work!

    I wonder is there Qt plugin for Postgresql under Android?

    1 條回覆 最後回覆
    0
    • M 離線
      M 離線
      mbnoimi
      寫於 最後由 編輯
      #2

      I read ton of posts and articles about my issue and I found that the best way is building web service for it because no one could build Qt SQL plugin for Android.

      This is really horrible news for me because:

      I don't know which is the start point to write the web service app. for my Postgresql database. Does Fortune Server is the right start point?

      I already coded a big Qt client so converting it to client compatible with web service means more code and I afraid it may a big :(

      May you please help me to find the right start point for developing the web service? and what's your advice for decreasing the modification in the client.?

      P.S. I feel very upset because when I created the desktop client I thought Qt is ready for Android I never expected that.

      1 條回覆 最後回覆
      0
      • SGaistS 離線
        SGaistS 離線
        SGaist
        Lifetime Qt Champion
        寫於 最後由 編輯
        #3

        Hi,

        This is not a Qt problem per se. The plugin needs a native build of PostgreSQL's library for android, which AFAIK doesn't exist.

        However I've seen "this":http://code.google.com/p/psqldroid that might interest you.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 條回覆 最後回覆
        0
        • A 離線
          A 離線
          antreimer
          寫於 最後由 編輯
          #4

          http://qt-project.org/wiki/Build_Qt5_postgresql_plugin_for_Android

          Here are the resulting libraries
          https://drive.google.com/folderview?id=0ByPpOAN5EsHKfmgwRTFvQUl5Z1NvUnlYMHptTEs0d2xEc24xZ19Jb0ZDMTBpb3JDQ014ZkU

          1 條回覆 最後回覆
          0
          • A 離線
            A 離線
            antreimer
            寫於 最後由 編輯
            #5

            http://qt-project.org/wiki/Build_Qt5_postgresql_plugin_for_Android

            Here are the resulting libraries
            https://drive.google.com/folderview?id=0ByPpOAN5EsHKfmgwRTFvQUl5Z1NvUnlYMHptTEs0d2xEc24xZ19Jb0ZDMTBpb3JDQ014ZkU

            1 條回覆 最後回覆
            0
            • A 離線
              A 離線
              akn10red
              寫於 最後由 編輯
              #6

              hello. a newbie here so pardon me foor noob question but can you please tell me if i can use these pre-built libraries to my project or i'll have to build myself? next problem is that i don't know how to add these .so libraries to my project. I tried to add this line in .pro file but that didn't work. the apk doesn't include this lib in the "lib" folder when seen using winRaR
              @LIBS += -L "e:\sqlib" -libpq.so@

              1 條回覆 最後回覆
              0
              • A 離線
                A 離線
                akn10red
                寫於 最後由 編輯
                #7

                hello. a newbie here so pardon me foor noob question but can you please tell me if i can use these pre-built libraries to my project or i'll have to build myself? next problem is that i don't know how to add these .so libraries to my project. I tried to add this line in .pro file but that didn't work. the apk doesn't include this lib in the "lib" folder when seen using winRaR
                @LIBS += -L "e:\sqlib" -libpq.so@

                1 條回覆 最後回覆
                0
                • A 離線
                  A 離線
                  antreimer
                  寫於 最後由 編輯
                  #8

                  "LIBS +=" is to link to libraries. If you want to include ".so" files in your apk you need to use the following line

                  @ANDROID_EXTRA_LIBS=/path/to/libpq.so@

                  1 條回覆 最後回覆
                  0
                  • A 離線
                    A 離線
                    antreimer
                    寫於 最後由 編輯
                    #9

                    "LIBS +=" is to link to libraries. If you want to include ".so" files in your apk you need to use the following line

                    @ANDROID_EXTRA_LIBS=/path/to/libpq.so@

                    1 條回覆 最後回覆
                    0
                    • A 離線
                      A 離線
                      akn10red
                      寫於 最後由 編輯
                      #10

                      thanks. now that the .so files are included, the application exits with the error "your application encountered a fatal error and cannot continue" upon launching :( not sure what to do with it and as i said i'm a noob to to figure it out :P

                      1 條回覆 最後回覆
                      0
                      • A 離線
                        A 離線
                        akn10red
                        寫於 最後由 編輯
                        #11

                        thanks. now that the .so files are included, the application exits with the error "your application encountered a fatal error and cannot continue" upon launching :( not sure what to do with it and as i said i'm a noob to to figure it out :P

                        1 條回覆 最後回覆
                        0
                        • A 離線
                          A 離線
                          akn10red
                          寫於 最後由 編輯
                          #12

                          this is the application output:

                          @I/Qt ( 7822): qt start
                          D/dalvikvm( 7822): Trying to load lib /data/data/org.qtproject.example.btchat/lib/libpq.so 0x411e6f98
                          W/System.err( 7822): java.lang.reflect.InvocationTargetException
                          W/System.err( 7822): at java.lang.reflect.Method.invokeNative(Native Method)
                          W/System.err( 7822): at java.lang.reflect.Method.invoke(Method.java:511)
                          W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
                          W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
                          W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
                          W/System.err( 7822): at android.app.Activity.performCreate(Activity.java:5008)
                          W/System.err( 7822): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
                          W/System.err( 7822): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
                          W/System.err( 7822): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
                          W/System.err( 7822): at android.app.ActivityThread.access$600(ActivityThread.java:130)
                          W/System.err( 7822): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                          W/System.err( 7822): at android.os.Handler.dispatchMessage(Handler.java:99)
                          W/System.err( 7822): at android.os.Looper.loop(Looper.java:137)
                          W/System.err( 7822): at android.app.ActivityThread.main(ActivityThread.java:4745)
                          W/System.err( 7822): at java.lang.reflect.Method.invokeNative(Native Method)
                          W/System.err( 7822): at java.lang.reflect.Method.invoke(Method.java:511)
                          W/System.err( 7822): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                          W/System.err( 7822): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                          W/System.err( 7822): at dalvik.system.NativeStart.main(Native Method)
                          W/System.err( 7822): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 36 cannot locate 'sigemptyset'...
                          W/System.err( 7822): at java.lang.Runtime.load(Runtime.java:340)
                          W/System.err( 7822): at java.lang.System.load(System.java:521)
                          W/System.err( 7822): at org.qtproject.qt5.android.QtNative.loadBundledLibraries(QtNative.java:156)
                          W/System.err( 7822): at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
                          W/System.err( 7822): ... 19 more@

                          1 條回覆 最後回覆
                          0
                          • A 離線
                            A 離線
                            akn10red
                            寫於 最後由 編輯
                            #13

                            this is the application output:

                            @I/Qt ( 7822): qt start
                            D/dalvikvm( 7822): Trying to load lib /data/data/org.qtproject.example.btchat/lib/libpq.so 0x411e6f98
                            W/System.err( 7822): java.lang.reflect.InvocationTargetException
                            W/System.err( 7822): at java.lang.reflect.Method.invokeNative(Native Method)
                            W/System.err( 7822): at java.lang.reflect.Method.invoke(Method.java:511)
                            W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.loadApplication(QtActivity.java:245)
                            W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:655)
                            W/System.err( 7822): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:895)
                            W/System.err( 7822): at android.app.Activity.performCreate(Activity.java:5008)
                            W/System.err( 7822): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
                            W/System.err( 7822): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
                            W/System.err( 7822): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
                            W/System.err( 7822): at android.app.ActivityThread.access$600(ActivityThread.java:130)
                            W/System.err( 7822): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
                            W/System.err( 7822): at android.os.Handler.dispatchMessage(Handler.java:99)
                            W/System.err( 7822): at android.os.Looper.loop(Looper.java:137)
                            W/System.err( 7822): at android.app.ActivityThread.main(ActivityThread.java:4745)
                            W/System.err( 7822): at java.lang.reflect.Method.invokeNative(Native Method)
                            W/System.err( 7822): at java.lang.reflect.Method.invoke(Method.java:511)
                            W/System.err( 7822): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                            W/System.err( 7822): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                            W/System.err( 7822): at dalvik.system.NativeStart.main(Native Method)
                            W/System.err( 7822): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 36 cannot locate 'sigemptyset'...
                            W/System.err( 7822): at java.lang.Runtime.load(Runtime.java:340)
                            W/System.err( 7822): at java.lang.System.load(System.java:521)
                            W/System.err( 7822): at org.qtproject.qt5.android.QtNative.loadBundledLibraries(QtNative.java:156)
                            W/System.err( 7822): at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:430)
                            W/System.err( 7822): ... 19 more@

                            1 條回覆 最後回覆
                            0
                            • A 離線
                              A 離線
                              antreimer
                              寫於 最後由 編輯
                              #14

                              The problem is this that it cannot locate 'sigemptyset'...

                              isgemptyset should be in libc.so but is missing in the older android builds.

                              The workaround that works for me was to staticlally link libc. I uploaded the changes and the lib is now 10x larger at 2MB. I'll update the wiki and include instructions to statically link.

                              1 條回覆 最後回覆
                              0
                              • A 離線
                                A 離線
                                antreimer
                                寫於 最後由 編輯
                                #15

                                The problem is this that it cannot locate 'sigemptyset'...

                                isgemptyset should be in libc.so but is missing in the older android builds.

                                The workaround that works for me was to staticlally link libc. I uploaded the changes and the lib is now 10x larger at 2MB. I'll update the wiki and include instructions to statically link.

                                1 條回覆 最後回覆
                                0
                                • A 離線
                                  A 離線
                                  akn10red
                                  寫於 最後由 編輯
                                  #16

                                  with the new lib file the app crashes without showing any message. and application output is:
                                  @{ . . .
                                  I/Qt (27083): qt start
                                  D/dalvikvm(27083): Trying to load lib /data/data/org.qtproject.example.btchat/lib/libpq.so 0x411e4508
                                  F/libc (27083): Fatal signal 11 (SIGSEGV) at 0x00006c23 (code=1), thread 27083 (.example.btchat)
                                  }@

                                  EDIT: The app seems to be working on my phone. However I don't know whether it should work the same way as described in Qt documentation or not. The code given under doesn't seem to be making database connection (hence else part is executed) :
                                  @
                                  QSqlDatabase db= QSqlDatabase::addDatabase("QPSQL");

                                      db.setHostName("89.129.198.19");
                                      db.setDatabaseName("abcde");
                                      db.setUserName("activa");
                                      db.setPassword("X123xyz");
                                      db.setPort(5432);
                                  
                                      bool ok = db.open();
                                  
                                      if(!ok)
                                          {
                                              QMessageBox::information(this,"Connection","Connection Failed!");
                                          }
                                      else
                                          {
                                               QMessageBox::information(this,"Connection","Connection Established!");
                                          }@
                                  
                                  1 條回覆 最後回覆
                                  0
                                  • A 離線
                                    A 離線
                                    akn10red
                                    寫於 最後由 編輯
                                    #17

                                    with the new lib file the app crashes without showing any message. and application output is:
                                    @{ . . .
                                    I/Qt (27083): qt start
                                    D/dalvikvm(27083): Trying to load lib /data/data/org.qtproject.example.btchat/lib/libpq.so 0x411e4508
                                    F/libc (27083): Fatal signal 11 (SIGSEGV) at 0x00006c23 (code=1), thread 27083 (.example.btchat)
                                    }@

                                    EDIT: The app seems to be working on my phone. However I don't know whether it should work the same way as described in Qt documentation or not. The code given under doesn't seem to be making database connection (hence else part is executed) :
                                    @
                                    QSqlDatabase db= QSqlDatabase::addDatabase("QPSQL");

                                        db.setHostName("89.129.198.19");
                                        db.setDatabaseName("abcde");
                                        db.setUserName("activa");
                                        db.setPassword("X123xyz");
                                        db.setPort(5432);
                                    
                                        bool ok = db.open();
                                    
                                        if(!ok)
                                            {
                                                QMessageBox::information(this,"Connection","Connection Failed!");
                                            }
                                        else
                                            {
                                                 QMessageBox::information(this,"Connection","Connection Established!");
                                            }@
                                    
                                    1 條回覆 最後回覆
                                    0
                                    • A 離線
                                      A 離線
                                      antreimer
                                      寫於 最後由 編輯
                                      #18

                                      The first so file I uploaded was only tested against lollipop. The second one was also tested against KitKat. I'll look into it. My brother has a Jellybean phone.

                                      Edit:

                                      I uploaded libpq.so now compiled with android-9.

                                      1 條回覆 最後回覆
                                      0
                                      • A 離線
                                        A 離線
                                        antreimer
                                        寫於 最後由 編輯
                                        #19

                                        The first so file I uploaded was only tested against lollipop. The second one was also tested against KitKat. I'll look into it. My brother has a Jellybean phone.

                                        Edit:

                                        I uploaded libpq.so now compiled with android-9.

                                        1 條回覆 最後回覆
                                        0
                                        • A 離線
                                          A 離線
                                          akn10red
                                          寫於 最後由 編輯
                                          #20

                                          [quote author="antreimer" date="1424547268"]The first so file I uploaded was only tested against lollipop. The second one was also tested against KitKat. I'll look into it. My brother has a Jellybean phone.[/quote]

                                          i've edited my post. please the app seems to be working on my phone but now the database connection is not being established :P

                                          BTW i'm testing it on KitKat too

                                          1 條回覆 最後回覆
                                          0

                                          • 登入

                                          • Login or register to search.
                                          • 第一個貼文
                                            最後的貼文
                                          0
                                          • 版面
                                          • 最新
                                          • 標籤
                                          • 熱門
                                          • 使用者
                                          • 群組
                                          • 搜尋
                                          • Get Qt Extensions
                                          • Unsolved